Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 9290822

Browse files
committed
added BlyncLight.status test
1 parent 206346d commit 9290822

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tests/test_blynclight.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ def light():
3939
pass
4040

4141
class MockDevice:
42-
@property
43-
def handle(self):
44-
return None
45-
4642
def write(self, data):
4743
return COMMAND_LENGTH
4844

@@ -446,3 +442,20 @@ def test_reseting_light(light, reset_field):
446442

447443
value = getattr(light, reset_field.name)
448444
assert value == reset_field.expected
445+
446+
447+
def test_status_property(light):
448+
""":param light: BlyncLight fixture
449+
450+
Confirms that the BlyncLight property 'status' is a
451+
dictionary, that keys of the dictionary are those
452+
enumerated by the commands property and that the
453+
values of the commands are integers.
454+
"""
455+
456+
status = light.status
457+
assert isinstance(status, dict)
458+
for command in light.commands:
459+
assert command in status.keys()
460+
value = status[command]
461+
assert isinstance(value, int)

0 commit comments

Comments
 (0)