Skip to content

Commit 7741028

Browse files
committed
Improve test-coverage for set_number()
1 parent 045ce33 commit 7741028

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

tests/test_adam.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ async def test_connect_adam_zone_per_device(self):
7979
)
8080
assert result
8181

82+
tinkered = await self.tinker_max_boiler_temp(smile, unhappy=True)
83+
assert not tinkered
84+
8285
try:
8386
await smile.delete_notification()
8487
notification_deletion = False # pragma: no cover
@@ -87,7 +90,7 @@ async def test_connect_adam_zone_per_device(self):
8790
assert notification_deletion
8891

8992
reboot = await self.tinker_reboot(smile, unhappy=True)
90-
assert not reboot
93+
assert reboot
9194

9295
await smile.close_connection()
9396
await self.disconnect(server, client)
@@ -324,6 +327,7 @@ async def test_connect_adam_plus_anna_new(self):
324327

325328
await self.tinker_gateway_mode(smile)
326329
await self.tinker_regulation_mode(smile)
330+
327331
tinkered = await self.tinker_max_boiler_temp(smile)
328332
assert tinkered
329333

@@ -354,6 +358,17 @@ async def test_connect_adam_plus_anna_new(self):
354358
await smile.close_connection()
355359
await self.disconnect(server, client)
356360

361+
self.smile_setup = "adam_plus_anna_new"
362+
testdata = self.load_testdata(SMILE_TYPE, self.smile_setup)
363+
server, smile, client = await self.connect_wrapper(raise_timeout=True)
364+
await self.device_test(smile, "2023-12-17 00:00:01", testdata)
365+
366+
tinkered = await self.tinker_max_boiler_temp(smile, unhappy=True)
367+
assert tinkered
368+
369+
await smile.close_connection()
370+
await self.disconnect(server, client)
371+
357372
@pytest.mark.asyncio
358373
async def test_adam_plus_jip(self):
359374
"""Test Adam with Jip setup."""

tests/test_init.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ async def tinker_reboot(self, smile, unhappy=False):
647647
except pw_exceptions.ConnectionFailedError:
648648
if unhappy:
649649
_LOGGER.info(" + failed as expected")
650-
return False
650+
return True
651651
else: # pragma: no cover
652652
_LOGGER.info(" - failed unexpectedly")
653653
return False
@@ -902,6 +902,7 @@ async def tinker_max_boiler_temp(smile, unhappy=False):
902902
new_temp = 60.0
903903
_LOGGER.info("- Adjusting temperature to %s", new_temp)
904904
for test in ["maximum_boiler_temperature", "bogus_temperature"]:
905+
_LOGGER.info(" + for %s", test)
905906
try:
906907
await smile.set_number("dummy", test, new_temp)
907908
_LOGGER.info(" + tinker_max_boiler_temp worked as intended")

0 commit comments

Comments
 (0)