mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +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)
|
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:
|
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.config_entries.async_setup(entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ async def test_user_device_exists_abort(
|
|||||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we abort user flow if printer already configured."""
|
"""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()
|
user_input = MOCK_USER_INPUT.copy()
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
@ -233,7 +233,7 @@ async def test_zeroconf_device_exists_abort(
|
|||||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we abort zeroconf flow if printer already configured."""
|
"""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()
|
discovery_info = MOCK_ZEROCONF_IPP_SERVICE_INFO.copy()
|
||||||
result = await hass.config_entries.flow.async_init(
|
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
|
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we abort zeroconf flow if printer already configured."""
|
"""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 = {
|
discovery_info = {
|
||||||
**MOCK_ZEROCONF_IPP_SERVICE_INFO,
|
**MOCK_ZEROCONF_IPP_SERVICE_INFO,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user