From d79a2bddfcd05f225b94e4014efcc887e07c3649 Mon Sep 17 00:00:00 2001 From: Ernst Klamer Date: Sat, 23 Sep 2023 14:45:23 +0200 Subject: [PATCH] fix tests --- custom_components/ble_monitor/test/test_bthome_v2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/ble_monitor/test/test_bthome_v2.py b/custom_components/ble_monitor/test/test_bthome_v2.py index 86050c598..95b126b78 100644 --- a/custom_components/ble_monitor/test/test_bthome_v2.py +++ b/custom_components/ble_monitor/test/test_bthome_v2.py @@ -1,4 +1,6 @@ """The tests for the BTHome (DIY sensor) ble_parser.""" +import datetime + from ble_monitor.ble_parser import BleParser @@ -759,7 +761,7 @@ def test_bthome_v2_timestamp(self): assert sensor_msg["mac"] == "5448E68F80A5" assert sensor_msg["packet"] == "no packet id" assert sensor_msg["data"] - assert sensor_msg["timestamp"] == "2023-5-14, 19:41:17" + assert sensor_msg["timestamp"] == datetime.datetime(2023, 5, 14, 19, 41, 17, tzinfo=datetime.timezone.utc) assert sensor_msg["rssi"] == -52 def test_bthome_v2_acceleration(self): @@ -810,7 +812,7 @@ def test_bthome_v2_text(self): assert sensor_msg["mac"] == "5448E68F80A5" assert sensor_msg["packet"] == "no packet id" assert sensor_msg["data"] - assert sensor_msg["text"] == 22.151 + assert sensor_msg["text"] == "Hello World!" assert sensor_msg["rssi"] == -52 def test_bthome_v2_double_temperature(self):