Skip to content

Commit d6fdf4d

Browse files
committed
Improve tinker_dhw_mode use, add skip_testing argument,
use to skip unnecessary testing
1 parent 04567ba commit d6fdf4d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/test_anna.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,22 @@ async def test_connect_anna_loria_heating_idle(self):
458458
"ERROR raised setting block cooling: %s", exc.value
459459
) # pragma: no cover
460460

461-
await self.tinker_dhw_mode(smile)
461+
tinkered = await self.tinker_dhw_mode(smile)
462+
assert not tinkered
462463

463464
await smile.close_connection()
464465
await self.disconnect(server, client)
465466

467+
server, smile, client = await self.connect_wrapper(raise_timeout=True)
468+
await self.device_test(smile, "2022-05-16 00:00:01", testdata, skip_testing=True)
469+
470+
tinkered = await self.tinker_dhw_mode(smile, unhappy=True)
471+
assert tinkered
472+
473+
await smile.close_connection()
474+
await self.disconnect(server, client)
475+
476+
466477
@pytest.mark.asyncio
467478
async def test_connect_anna_loria_cooling_active(self):
468479
"""Test an Anna with a Loria in heating mode - state idle."""

tests/test_init.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ async def device_test(
536536
test_time=None,
537537
testdata=None,
538538
initialize=True,
539+
skip_testing=False,
539540
):
540541
"""Perform basic device tests."""
541542
bsw_list = ["binary_sensors", "central", "climate", "sensors", "switches"]
@@ -588,6 +589,9 @@ async def device_test(
588589
_LOGGER.info("Device list = %s", data.devices)
589590
self.show_setup(location_list, data.devices)
590591

592+
if skip_testing:
593+
return
594+
591595
# Perform tests and asserts
592596
tests = 0
593597
asserts = 0

0 commit comments

Comments
 (0)