Skip to content

Commit 27be406

Browse files
committed
CR: Nitpicks
SonarQube: improve test code
1 parent 1efce6b commit 27be406

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugwise_usb/nodes/sed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ async def set_sleep_duration(self, minutes: int) -> bool:
327327
# endregion
328328
# region Properties
329329
@property
330-
def dirty(self) -> int:
330+
def dirty(self) -> bool:
331331
"""Battery configuration dirty flag."""
332332
return self._battery_config.dirty
333333

tests/test_usb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ async def test_msg_properties(self) -> None:
332332
)
333333
assert unix_timestamp.serialize() == b"4E08478A"
334334
with pytest.raises(pw_exceptions.MessageError):
335-
unix_timestamp.value == dt(2011, 6, 27, 9, 4, 10, tzinfo=UTC)
335+
unix_timestamp.value
336336
unix_timestamp.deserialize(b"4E08478A")
337337
assert unix_timestamp.value == dt(2011, 6, 27, 9, 4, 10, tzinfo=UTC)
338338

@@ -501,7 +501,7 @@ async def test_stick_connection_lost(self, monkeypatch: pytest.MonkeyPatch) -> N
501501

502502
async def node_awake(self, event: pw_api.NodeEvent, mac: str) -> None: # type: ignore[name-defined]
503503
"""Handle awake event callback."""
504-
_LOGGER.debug("Node %s has even %s", mac, str(pw_api.NodeEvent))
504+
_LOGGER.debug("Node %s has event %s", mac, str(pw_api.NodeEvent))
505505
if event == pw_api.NodeEvent.AWAKE:
506506
self.test_node_awake.set_result(mac)
507507
else:

0 commit comments

Comments
 (0)