@@ -22,7 +22,7 @@ def test_get_sites(self, api):
22
22
httpretty .GET , BASE_URL + "/site" , body = get_sites .read ()
23
23
)
24
24
sites = api .get_sites ()
25
- assert len (sites ) == 2
25
+ assert len (sites ) == 3
26
26
assert sites [0 ].id == "site-1"
27
27
assert sites [0 ].label == "TaHoma"
28
28
assert sites [1 ].id == "site-2"
@@ -43,9 +43,12 @@ def test_devices(self, api):
43
43
sites_path = os .path .join (CURRENT_DIR , "get_sites.json" )
44
44
devices_path_1 = os .path .join (CURRENT_DIR , "get_devices_1.json" )
45
45
devices_path_2 = os .path .join (CURRENT_DIR , "get_devices_2.json" )
46
+ devices_path_3 = os .path .join (CURRENT_DIR , "get_devices_3.json" )
46
47
with open (sites_path , "r" ) as get_sites , open (
47
48
devices_path_1 , "r"
48
- ) as get_devices_1 , open (devices_path_2 , "r" ) as get_devices_2 :
49
+ ) as get_devices_1 , open (devices_path_2 , "r" ) as get_devices_2 , open (
50
+ devices_path_3 , "r"
51
+ ) as get_devices_3 :
49
52
httpretty .register_uri (
50
53
httpretty .GET , BASE_URL + "/site" , body = get_sites .read ()
51
54
)
@@ -59,6 +62,12 @@ def test_devices(self, api):
59
62
BASE_URL + "/site/site-2/device" ,
60
63
body = get_devices_2 .read (),
61
64
)
65
+ httpretty .register_uri (
66
+ httpretty .GET ,
67
+ BASE_URL + "/site/site-3/device" ,
68
+ body = get_devices_3 .read (),
69
+ status = 404 ,
70
+ )
62
71
63
72
assert len (api .get_devices ()) == 4
64
73
assert len (api .get_devices ("site-1" )) == 3
0 commit comments