Avoid creating sockets in homekit port available tests (#55668)

* Avoid creating sockets in homekit port available tests

* prevent new bridge from being setup -- its too fast now that the executor job is gone and it revealed an unpatched setup
This commit is contained in:
J. Nick Koston 2021-09-03 17:15:28 -10:00 committed by GitHub
parent 0dc8fb497b
commit 195ee2a188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 34 deletions

View file

@ -951,10 +951,15 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result2["step_id"] == "cameras"
result3 = await hass.config_entries.options.async_configure(
result2["flow_id"],
user_input={"camera_copy": ["camera.tv"]},
)
with patch(
"homeassistant.components.homekit.async_setup_entry",
return_value=True,
) as mock_setup_entry:
result3 = await hass.config_entries.options.async_configure(
result2["flow_id"],
user_input={"camera_copy": ["camera.tv"]},
)
await hass.async_block_till_done()
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert config_entry.options == {
@ -968,6 +973,7 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
"include_entities": ["camera.tv"],
},
}
assert len(mock_setup_entry.mock_calls) == 1
def _get_schema_default(schema, key_name):