Skip to content

Commit

Permalink
Add test to check that last_update is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jason0x43 committed Apr 11, 2021
1 parent 1a7b8e6 commit e35e3dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hubitatmaker/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ def test_device_can_serialize(self) -> None:
f"{d}",
'<Device id="6" name="Office Door" type="Generic Z-Wave Contact Sensor">',
)

def test_device_records_last_update_time(self) -> None:
"""A device should be serializable."""
d = Device(device_details["6"])
update = d.last_update
self.assertIsNotNone(update)

d.update_attr("contact", "closed")
self.assertNotEqual(update, d.last_update)

0 comments on commit e35e3dc

Please sign in to comment.