Optimize ipp tests (#38485)

* optimize ipp tests

* Update test_config_flow.py
This commit is contained in:
Chris Talkington 2020-08-02 18:02:47 -05:00 committed by GitHub
parent 428c376fe4
commit 1e685a4a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -143,15 +143,16 @@ async def init_integration(
entry.add_to_hass(hass)
mock_connection(
aioclient_mock,
host=host,
port=port,
ssl=ssl,
base_path=base_path,
conn_error=conn_error,
)
if not skip_setup:
mock_connection(
aioclient_mock,
host=host,
port=port,
ssl=ssl,
base_path=base_path,
conn_error=conn_error,
)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()

View File

@ -218,7 +218,7 @@ async def test_user_device_exists_abort(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort user flow if printer already configured."""
await init_integration(hass, aioclient_mock)
await init_integration(hass, aioclient_mock, skip_setup=True)
user_input = MOCK_USER_INPUT.copy()
result = await hass.config_entries.flow.async_init(
@ -233,7 +233,7 @@ async def test_zeroconf_device_exists_abort(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort zeroconf flow if printer already configured."""
await init_integration(hass, aioclient_mock)
await init_integration(hass, aioclient_mock, skip_setup=True)
discovery_info = MOCK_ZEROCONF_IPP_SERVICE_INFO.copy()
result = await hass.config_entries.flow.async_init(
@ -248,7 +248,7 @@ async def test_zeroconf_with_uuid_device_exists_abort(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test we abort zeroconf flow if printer already configured."""
await init_integration(hass, aioclient_mock)
await init_integration(hass, aioclient_mock, skip_setup=True)
discovery_info = {
**MOCK_ZEROCONF_IPP_SERVICE_INFO,