Skip to content

Commit 6532f43

Browse files
committed
test: update log format to include timestamps and dates
test: update logmessage with package name chore: fix tests to use valid zeo codes
1 parent 837ef10 commit 6532f43

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,5 @@ select=["E", "F", "UP", "I"]
7272
[tool.pytest.ini_options]
7373
asyncio_mode = "auto"
7474
log_cli_level = "DEBUG"
75+
log_format = "%(asctime)s %(levelname)s %(name)s:%(filename)s:%(lineno)s %(message)s"
76+
log_date_format = "%Y-%m-%d %H:%M:%S"

roborock/version_a01_apis/roborock_client_a01.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def on_message_received(self, messages: list[RoborockMessage]) -> None:
128128
continue
129129
payload_json = json.loads(payload.decode())
130130
for data_point_number, data_point in payload_json.get("dps").items():
131-
self._logger.debug("data point number=%s", data_point_number)
132131
data_point_protocol: RoborockDyadDataProtocol | RoborockZeoProtocol
132+
self._logger.debug("received msg with dps, protocol: %s, %s", data_point_number, protocol)
133133
entries: dict
134134
if self.category == RoborockCategory.WET_DRY_VAC:
135135
data_point_protocol = RoborockDyadDataProtocol(int(data_point_number))

tests/test_a01_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ async def test_update_values(
174174

175175
message = build_rpc_response(
176176
{
177-
203: [[16, "2362048"], [17, "2362044"]],
177+
203: 6,
178178
}
179179
)
180180
response_queue.put(mqtt_packet.gen_publish(MQTT_PUBLISH_TOPIC, payload=message))
181181

182182
data = await connected_a01_mqtt_client.update_values([RoborockZeoProtocol.STATE])
183-
assert data.get(RoborockZeoProtocol.STATE) == "standby"
183+
assert data.get(RoborockZeoProtocol.STATE) == "spinningdata point number="
184184

185185

186186
async def test_publish_failure(

0 commit comments

Comments
 (0)