Skip to content

Commit 4d181d4

Browse files
committed
New test for Device initialzier
1 parent 4bfe2eb commit 4d181d4

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
@@ -58,3 +58,17 @@ def test_create_camera_stream():
5858
assert camera_stream.rtsp_stream_url == "rtsp://123.com"
5959
assert camera_stream.stream_token == "token"
6060
assert camera_stream.expires_at == datetime.strptime("2020-01-01T00:00:01.000Z", "%Y-%m-%dT%H:%M:%S.%fZ")
61+
62+
63+
def test_create_device():
64+
response = {
65+
"name": "0/1/2/device_id",
66+
"type": "type",
67+
"traits": {"trait": "trait"}
68+
}
69+
70+
device = nestdeviceaccess.Device(response)
71+
assert device.name == "0/1/2/device_id"
72+
assert device.device_id == "device_id"
73+
assert device.type == "type"
74+
assert device.traits == {"trait": "trait"}

0 commit comments

Comments
 (0)