mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Fix socket usage in Aprs test (#60253)
This commit is contained in:
parent
4555f52e50
commit
e1de6612be
@ -327,19 +327,18 @@ def test_setup_scanner():
|
|||||||
|
|
||||||
def test_setup_scanner_timeout():
|
def test_setup_scanner_timeout():
|
||||||
"""Test setup_scanner failure from timeout."""
|
"""Test setup_scanner failure from timeout."""
|
||||||
hass = get_test_home_assistant()
|
with patch("aprslib.IS.connect", side_effect=TimeoutError):
|
||||||
hass.start()
|
hass = get_test_home_assistant()
|
||||||
|
hass.start()
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"username": TEST_CALLSIGN,
|
"username": TEST_CALLSIGN,
|
||||||
"password": TEST_PASSWORD,
|
"password": TEST_PASSWORD,
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"timeout": 0.01,
|
"timeout": 0.01,
|
||||||
"callsigns": ["XX0FOO*", "YY0BAR-1"],
|
"callsigns": ["XX0FOO*", "YY0BAR-1"],
|
||||||
}
|
}
|
||||||
|
|
||||||
see = Mock()
|
see = Mock()
|
||||||
try:
|
|
||||||
assert not device_tracker.setup_scanner(hass, config, see)
|
assert not device_tracker.setup_scanner(hass, config, see)
|
||||||
finally:
|
|
||||||
hass.stop()
|
hass.stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user