Skip to content

Commit

Permalink
WTH with test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
javicalle committed Sep 10, 2022
1 parent c593c62 commit 83ef4df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_tuya_mcu.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ async def test_tuya_version(zigpy_device_from_quirk, quirk):
assert cluster_listener.attribute_updates[0][0] == ATTR_MCU_VERSION
assert cluster_listener.attribute_updates[0][1] == "2.0.2"


with mock.patch.object(tuya_cluster, "handle_mcu_version_response") as m1:
tuya_cluster.handle_message(hdr, args)

Expand All @@ -56,7 +55,9 @@ async def test_tuya_version(zigpy_device_from_quirk, quirk):
assert cluster_listener.cluster_commands[1][2].version.version_raw == 130
assert cluster_listener.cluster_commands[1][2].version.version == "2.0.2"

m1.assert_called_once_with(tuya_cluster.MCUVersion(status=1, tsn=109, version_raw=130))
m1.assert_called_once_with(
tuya_cluster.MCUVersion(status=1, tsn=109, version_raw=130)
)

# read 'mcu_version' from cluster's attributes
succ, fail = await tuya_cluster.read_attributes(("mcu_version",))
Expand Down

0 comments on commit 83ef4df

Please sign in to comment.