Skip to content

Commit 100f19d

Browse files
committed
Add test for creating camera stream with wrong device
1 parent 4d181d4 commit 100f19d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

nestdeviceaccess/test_nestdeviceaccess.py

+14
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,17 @@ def test_create_device():
7272
assert device.device_id == "device_id"
7373
assert device.type == "type"
7474
assert device.traits == {"trait": "trait"}
75+
76+
77+
def test_create_camera_stream_with_non_camera():
78+
response = {
79+
"name": "0/1/2/device_id",
80+
"type": "type",
81+
"traits": {"trait": "trait"}
82+
}
83+
device = nestdeviceaccess.Device(response)
84+
85+
nda = nestdeviceaccess.NestDeviceAccess(project_id="123", client_secret="123", client_id="123", code="123")
86+
87+
with pytest.raises(nestdeviceaccess.InvalidActionError):
88+
nda.get_camera_stream(device)

0 commit comments

Comments
 (0)