mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Add test
This commit is contained in:
parent
0f3e4fc675
commit
018af9eca3
@ -602,3 +602,16 @@ async def test_protocol_will_retry_on_write(
|
|||||||
expected_call_count = retry_count + 1 if retry_expectation else 1
|
expected_call_count = retry_count + 1 if retry_expectation else 1
|
||||||
assert conn.call_count == expected_call_count
|
assert conn.call_count == expected_call_count
|
||||||
assert write_mock.call_count == expected_call_count
|
assert write_mock.call_count == expected_call_count
|
||||||
|
|
||||||
|
|
||||||
|
def test_deprecated_protocol():
|
||||||
|
with pytest.deprecated_call():
|
||||||
|
from kasa import TPLinkSmartHomeProtocol
|
||||||
|
|
||||||
|
with pytest.raises(
|
||||||
|
SmartDeviceException, match="host or transport must be supplied"
|
||||||
|
):
|
||||||
|
proto = TPLinkSmartHomeProtocol()
|
||||||
|
host = "127.0.0.1"
|
||||||
|
proto = TPLinkSmartHomeProtocol(host=host)
|
||||||
|
assert proto.config.host == host
|
||||||
|
Loading…
Reference in New Issue
Block a user