-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Fix asuswrt network failure startup #33485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7b9cbcc
89e1aa6
d107dd3
54f14fa
7c47f59
0e9ca46
09ec351
ce793c1
b6e82ad
f453b81
622a14f
3728833
e7b40a8
434e10f
0aa0ed6
9b5d9e8
9546690
ec5682b
046771f
f07031f
f052d23
6b6cb97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,18 @@ async def test_password_or_pub_key_required(hass): | |
| assert not result | ||
|
|
||
|
|
||
| async def test_network_unreachable(hass): | ||
| """Test creating an AsusWRT scanner without a pass or pubkey.""" | ||
| with patch("homeassistant.components.asuswrt.AsusWrt") as AsusWrt: | ||
| AsusWrt().connection.async_connect = mock_coro_func(exception=OSError) | ||
| AsusWrt().is_connected = False | ||
| result = await async_setup_component( | ||
| hass, DOMAIN, {DOMAIN: {CONF_HOST: "fake_host", CONF_USERNAME: "fake_user"}} | ||
| ) | ||
| assert result | ||
|
MartinHjelmare marked this conversation as resolved.
|
||
| assert hass.data.get(DATA_ASUSWRT, None) is None | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better if we tested the existence of states in the state machine. When there's an error there shouldn't be any states. After the error clears, the setup should complete and states be created. That way we don't rely on the details of our implementation in the tests.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I will keeep in consideration for next PR. Thx |
||
|
|
||
|
|
||
| async def test_get_scanner_with_password_no_pubkey(hass): | ||
| """Test creating an AsusWRT scanner with a password and no pubkey.""" | ||
| with patch("homeassistant.components.asuswrt.AsusWrt") as AsusWrt: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.