Skip to content

Commit 21a659c

Browse files
committed
Extend device_test(), make it possible to run async_update() alone
Tnx @CoMPaTech
1 parent 7719d7f commit 21a659c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_smile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,15 @@ def show_setup(location_list, device_list):
375375
assert False
376376

377377
@pytest.mark.asyncio
378-
async def device_test(self, smile=pw_smile.Smile, testdata=None):
378+
async def device_test(self, smile=pw_smile.Smile, testdata=None, initialize=True):
379379
"""Perform basic device tests."""
380380
_LOGGER.info("Asserting testdata:")
381381
bsw_list = ["binary_sensors", "central", "climate", "sensors", "switches"]
382382
# Make sure to test with the day set to Sunday, needed for full testcoverage of schedules_temps()
383383
with freeze_time("2022-05-16 00:00:01"):
384-
await smile._full_update_device()
385-
smile.get_all_devices()
384+
if initialize:
385+
await smile._full_update_device()
386+
smile.get_all_devices()
386387
data = await smile.async_update()
387388

388389
if "heater_id" in data.gateway:
@@ -3557,7 +3558,6 @@ async def test_adam_plus_jip(self):
35573558
good_schedules=[None],
35583559
)
35593560
assert result
3560-
35613561
await smile.close_connection()
35623562
await self.disconnect(server, client)
35633563

0 commit comments

Comments
 (0)