mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Optimize ipp tests (#38485)
* optimize ipp tests * Update test_config_flow.py
This commit is contained in:
parent
428c376fe4
commit
1e685a4a00
@ -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()
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user