-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtests.py
72 lines (56 loc) · 1.41 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import json, unittest
from blink import Blink
class TestBlink(unittest.TestCase):
def test_connect(self):
b = Blink()
self.assertFalse(b.connected)
b.connect()
self.assertTrue(b.connected)
def test_homescreen(self):
b = Blink()
data = b.homescreen()
self.assertTrue(data['account'] is not None)
def test_events(self):
b = Blink()
b.connect()
events = b.events(b.networks[0])
self.assertEqual(type(events), list)
def test_cameras(self):
b = Blink()
b.connect()
cameras = b.cameras(b.networks[0])
self.assertEqual(type(cameras), list)
def test_download_video(self):
b = Blink()
b.connect()
events = b.events(b.networks[0])
event = events[0]
b.download_video(event)
def _test_download_thumbnail(self):
'''doesn't work'''
b = Blink()
b.connect()
network_id = b.networks[0]['id']
events = b.events(network_id)
event = events[0]
b.download_thumbnail(event)
def test_sync_modules(self):
b = Blink()
b.connect()
sync_modules = b.sync_modules(b.networks[0])
print sync_modules
def _test_arm(self):
b = Blink()
b.connect()
print b.arm(b.networks[0])
def test_clients(self):
b = Blink()
print b.clients()
def test_regions(self):
b = Blink()
print b.regions()
def _test_health(self):
b = Blink()
print b.health()
if __name__ == '__main__':
unittest.main()