Skip to content

Commit 6b9b7e4

Browse files
committed
Cleanup
1 parent 86ac330 commit 6b9b7e4

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

plugwise/smile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ async def connect(self):
169169
except InvalidXMLError: # pragma: no cover
170170
# Corner case check
171171
raise ConnectionFailedError
172-
else:
172+
else: # pragma: no cover
173+
# No cornercase, just end of the line
173174
_LOGGER.error("Connected but no gateway device information found")
174175
raise ConnectionFailedError
175176

tests/test_smile.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ async def connect_wrapper(self, raise_timeout=False, fail_auth=False):
278278
_LOGGER.error(" - invalid credentials not handled")
279279
raise self.ConnectError
280280
except pw_exceptions.InvalidAuthentication:
281-
_LOGGER.info(" + successfully passed credentials handling.")
281+
_LOGGER.info(" + successfully aborted on credentials missing.")
282+
raise pw_exceptions.InvalidAuthentication
282283

283284
if raise_timeout:
284285
_LOGGER.warning("Connecting to device exceeding timeout in handling:")
@@ -1486,18 +1487,14 @@ async def test_invalid_credentials(self):
14861487
await self.connect_wrapper(fail_auth=True)
14871488
assert False
14881489
except pw_exceptions.InvalidAuthentication:
1489-
_LOGGER.debug("InvalidAuthentication raised")
1490-
assert True
1491-
except Exception as exception:
1492-
_LOGGER.debug("Other")
1493-
_LOGGER.debug(format(exception))
1490+
_LOGGER.debug("InvalidAuthentication raised successfully")
14941491
assert True
14951492

14961493
@pytest.mark.asyncio
1497-
async def test_connect_p1vfail(self):
1494+
async def test_connect_fail_firmware(self):
14981495
"""Test a P1 non existing firmware setup."""
14991496

1500-
self.smile_setup = "p1vfail"
1497+
self.smile_setup = "fail_firmware"
15011498
try:
15021499
await self.connect_wrapper()
15031500
except pw_exceptions.UnsupportedDeviceError:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)