mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Cleanup mqtt platform tests part 1 (#120470)
This commit is contained in:
parent
5983344746
commit
038f2ce79f
@ -1167,10 +1167,7 @@ async def test_entity_device_info_remove(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test device registry remove."""
|
"""Test device registry remove."""
|
||||||
await help_test_entity_device_info_remove(
|
await help_test_entity_device_info_remove(
|
||||||
hass,
|
hass, mqtt_mock_entry, alarm_control_panel.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
alarm_control_panel.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1188,10 +1185,7 @@ async def test_entity_id_update_discovery_update(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT discovery update when entity_id is updated."""
|
"""Test MQTT discovery update when entity_id is updated."""
|
||||||
await help_test_entity_id_update_discovery_update(
|
await help_test_entity_id_update_discovery_update(
|
||||||
hass,
|
hass, mqtt_mock_entry, alarm_control_panel.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
alarm_control_panel.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -977,10 +977,7 @@ async def test_entity_device_info_with_connection(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT binary sensor device registry integration."""
|
"""Test MQTT binary sensor device registry integration."""
|
||||||
await help_test_entity_device_info_with_connection(
|
await help_test_entity_device_info_with_connection(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -989,10 +986,7 @@ async def test_entity_device_info_with_identifier(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT binary sensor device registry integration."""
|
"""Test MQTT binary sensor device registry integration."""
|
||||||
await help_test_entity_device_info_with_identifier(
|
await help_test_entity_device_info_with_identifier(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1001,10 +995,7 @@ async def test_entity_device_info_update(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test device registry update."""
|
"""Test device registry update."""
|
||||||
await help_test_entity_device_info_update(
|
await help_test_entity_device_info_update(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1013,10 +1004,7 @@ async def test_entity_device_info_remove(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test device registry remove."""
|
"""Test device registry remove."""
|
||||||
await help_test_entity_device_info_remove(
|
await help_test_entity_device_info_remove(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1034,10 +1022,7 @@ async def test_entity_id_update_discovery_update(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT discovery update when entity_id is updated."""
|
"""Test MQTT discovery update when entity_id is updated."""
|
||||||
await help_test_entity_id_update_discovery_update(
|
await help_test_entity_id_update_discovery_update(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1046,11 +1031,7 @@ async def test_entity_debug_info_message(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT debug info."""
|
"""Test MQTT debug info."""
|
||||||
await help_test_entity_debug_info_message(
|
await help_test_entity_debug_info_message(
|
||||||
hass,
|
hass, mqtt_mock_entry, binary_sensor.DOMAIN, DEFAULT_CONFIG, None
|
||||||
mqtt_mock_entry,
|
|
||||||
binary_sensor.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1104,10 +1085,10 @@ async def test_cleanup_triggers_and_restoring_state(
|
|||||||
tmp_path: Path,
|
tmp_path: Path,
|
||||||
freezer: FrozenDateTimeFactory,
|
freezer: FrozenDateTimeFactory,
|
||||||
hass_config: ConfigType,
|
hass_config: ConfigType,
|
||||||
payload1,
|
payload1: str,
|
||||||
state1,
|
state1: str,
|
||||||
payload2,
|
payload2: str,
|
||||||
state2,
|
state2: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test cleanup old triggers at reloading and restoring the state."""
|
"""Test cleanup old triggers at reloading and restoring the state."""
|
||||||
freezer.move_to("2022-02-02 12:01:00+01:00")
|
freezer.move_to("2022-02-02 12:01:00+01:00")
|
||||||
@ -1196,8 +1177,7 @@ async def test_setup_manual_entity_from_yaml(
|
|||||||
|
|
||||||
|
|
||||||
async def test_unload_entry(
|
async def test_unload_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test unloading the config entry."""
|
"""Test unloading the config entry."""
|
||||||
domain = binary_sensor.DOMAIN
|
domain = binary_sensor.DOMAIN
|
||||||
|
@ -159,13 +159,7 @@ async def test_default_availability_payload(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
await help_test_default_availability_payload(
|
await help_test_default_availability_payload(
|
||||||
hass,
|
hass, mqtt_mock_entry, button.DOMAIN, config, True, "state-topic", "1"
|
||||||
mqtt_mock_entry,
|
|
||||||
button.DOMAIN,
|
|
||||||
config,
|
|
||||||
True,
|
|
||||||
"state-topic",
|
|
||||||
"1",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -184,13 +178,7 @@ async def test_custom_availability_payload(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await help_test_custom_availability_payload(
|
await help_test_custom_availability_payload(
|
||||||
hass,
|
hass, mqtt_mock_entry, button.DOMAIN, config, True, "state-topic", "1"
|
||||||
mqtt_mock_entry,
|
|
||||||
button.DOMAIN,
|
|
||||||
config,
|
|
||||||
True,
|
|
||||||
"state-topic",
|
|
||||||
"1",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,11 +222,7 @@ async def test_update_with_json_attrs_not_dict(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test attributes get extracted from a JSON result."""
|
"""Test attributes get extracted from a JSON result."""
|
||||||
await help_test_update_with_json_attrs_not_dict(
|
await help_test_update_with_json_attrs_not_dict(
|
||||||
hass,
|
hass, mqtt_mock_entry, caplog, camera.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
caplog,
|
|
||||||
camera.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -237,11 +233,7 @@ async def test_update_with_json_attrs_bad_json(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test attributes get extracted from a JSON result."""
|
"""Test attributes get extracted from a JSON result."""
|
||||||
await help_test_update_with_json_attrs_bad_json(
|
await help_test_update_with_json_attrs_bad_json(
|
||||||
hass,
|
hass, mqtt_mock_entry, caplog, camera.DOMAIN, DEFAULT_CONFIG
|
||||||
mqtt_mock_entry,
|
|
||||||
caplog,
|
|
||||||
camera.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -368,11 +360,7 @@ async def test_entity_id_update_subscriptions(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test MQTT subscriptions are managed when entity_id is updated."""
|
"""Test MQTT subscriptions are managed when entity_id is updated."""
|
||||||
await help_test_entity_id_update_subscriptions(
|
await help_test_entity_id_update_subscriptions(
|
||||||
hass,
|
hass, mqtt_mock_entry, camera.DOMAIN, DEFAULT_CONFIG, ["test_topic"]
|
||||||
mqtt_mock_entry,
|
|
||||||
camera.DOMAIN,
|
|
||||||
DEFAULT_CONFIG,
|
|
||||||
["test_topic"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,9 +191,7 @@ async def test_get_hvac_modes(
|
|||||||
|
|
||||||
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
||||||
async def test_set_operation_bad_attr_and_state(
|
async def test_set_operation_bad_attr_and_state(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting operation mode without required attribute.
|
"""Test setting operation mode without required attribute.
|
||||||
|
|
||||||
@ -454,9 +452,7 @@ async def test_turn_on_and_off_without_power_command(
|
|||||||
|
|
||||||
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
||||||
async def test_set_fan_mode_bad_attr(
|
async def test_set_fan_mode_bad_attr(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting fan mode without required attribute."""
|
"""Test setting fan mode without required attribute."""
|
||||||
await mqtt_mock_entry()
|
await mqtt_mock_entry()
|
||||||
@ -551,9 +547,7 @@ async def test_set_fan_mode(
|
|||||||
|
|
||||||
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
||||||
async def test_set_swing_mode_bad_attr(
|
async def test_set_swing_mode_bad_attr(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting swing mode without required attribute."""
|
"""Test setting swing mode without required attribute."""
|
||||||
await mqtt_mock_entry()
|
await mqtt_mock_entry()
|
||||||
@ -1046,9 +1040,7 @@ async def test_handle_action_received(
|
|||||||
|
|
||||||
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
@pytest.mark.parametrize("hass_config", [DEFAULT_CONFIG])
|
||||||
async def test_set_preset_mode_optimistic(
|
async def test_set_preset_mode_optimistic(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting of the preset mode."""
|
"""Test setting of the preset mode."""
|
||||||
mqtt_mock = await mqtt_mock_entry()
|
mqtt_mock = await mqtt_mock_entry()
|
||||||
@ -1104,9 +1096,7 @@ async def test_set_preset_mode_optimistic(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_set_preset_mode_explicit_optimistic(
|
async def test_set_preset_mode_explicit_optimistic(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting of the preset mode."""
|
"""Test setting of the preset mode."""
|
||||||
mqtt_mock = await mqtt_mock_entry()
|
mqtt_mock = await mqtt_mock_entry()
|
||||||
@ -1523,9 +1513,7 @@ async def test_get_with_templates(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_set_and_templates(
|
async def test_set_and_templates(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
caplog: pytest.LogCaptureFixture,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test setting various attributes with templates."""
|
"""Test setting various attributes with templates."""
|
||||||
mqtt_mock = await mqtt_mock_entry()
|
mqtt_mock = await mqtt_mock_entry()
|
||||||
@ -2074,11 +2062,7 @@ async def test_entity_id_update_subscriptions(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
await help_test_entity_id_update_subscriptions(
|
await help_test_entity_id_update_subscriptions(
|
||||||
hass,
|
hass, mqtt_mock_entry, climate.DOMAIN, config, ["test-topic", "avty-topic"]
|
||||||
mqtt_mock_entry,
|
|
||||||
climate.DOMAIN,
|
|
||||||
config,
|
|
||||||
["test-topic", "avty-topic"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -2170,20 +2154,8 @@ async def test_precision_whole(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("service", "topic", "parameters", "payload", "template"),
|
("service", "topic", "parameters", "payload", "template"),
|
||||||
[
|
[
|
||||||
(
|
(climate.SERVICE_TURN_ON, "power_command_topic", {}, "ON", None),
|
||||||
climate.SERVICE_TURN_ON,
|
(climate.SERVICE_TURN_OFF, "power_command_topic", {}, "OFF", None),
|
||||||
"power_command_topic",
|
|
||||||
{},
|
|
||||||
"ON",
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
(
|
|
||||||
climate.SERVICE_TURN_OFF,
|
|
||||||
"power_command_topic",
|
|
||||||
{},
|
|
||||||
"OFF",
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
climate.SERVICE_SET_HVAC_MODE,
|
climate.SERVICE_SET_HVAC_MODE,
|
||||||
"mode_command_topic",
|
"mode_command_topic",
|
||||||
@ -2346,9 +2318,7 @@ async def test_publishing_with_custom_encoding(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_humidity_configuration_validity(
|
async def test_humidity_configuration_validity(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator, valid: bool
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
valid: bool,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the validity of humidity configurations."""
|
"""Test the validity of humidity configurations."""
|
||||||
assert await mqtt_mock_entry()
|
assert await mqtt_mock_entry()
|
||||||
@ -2357,8 +2327,7 @@ async def test_humidity_configuration_validity(
|
|||||||
|
|
||||||
|
|
||||||
async def test_reloadable(
|
async def test_reloadable(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_client_mock: MqttMockPahoClient
|
||||||
mqtt_client_mock: MqttMockPahoClient,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test reloading the MQTT platform."""
|
"""Test reloading the MQTT platform."""
|
||||||
domain = climate.DOMAIN
|
domain = climate.DOMAIN
|
||||||
@ -2381,8 +2350,7 @@ async def test_setup_manual_entity_from_yaml(
|
|||||||
|
|
||||||
|
|
||||||
async def test_unload_entry(
|
async def test_unload_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test unloading the config entry."""
|
"""Test unloading the config entry."""
|
||||||
domain = climate.DOMAIN
|
domain = climate.DOMAIN
|
||||||
|
@ -187,11 +187,11 @@ def mock_process_uploaded_file(
|
|||||||
yield mock_upload
|
yield mock_upload
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("mqtt_client_mock")
|
||||||
async def test_user_connection_works(
|
async def test_user_connection_works(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_finish_setup: MagicMock,
|
mock_finish_setup: MagicMock,
|
||||||
mqtt_client_mock: MqttMockPahoClient,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we can finish a config flow."""
|
"""Test we can finish a config flow."""
|
||||||
mock_try_connection.return_value = True
|
mock_try_connection.return_value = True
|
||||||
@ -217,11 +217,11 @@ async def test_user_connection_works(
|
|||||||
assert len(mock_finish_setup.mock_calls) == 1
|
assert len(mock_finish_setup.mock_calls) == 1
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("mqtt_client_mock")
|
||||||
async def test_user_v5_connection_works(
|
async def test_user_v5_connection_works(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_finish_setup: MagicMock,
|
mock_finish_setup: MagicMock,
|
||||||
mqtt_client_mock: MqttMockPahoClient,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we can finish a config flow."""
|
"""Test we can finish a config flow."""
|
||||||
mock_try_connection.return_value = True
|
mock_try_connection.return_value = True
|
||||||
@ -664,11 +664,11 @@ async def test_bad_certificate(
|
|||||||
("100", False),
|
("100", False),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@pytest.mark.usefixtures("mock_reload_after_entry_update")
|
||||||
async def test_keepalive_validation(
|
async def test_keepalive_validation(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_reload_after_entry_update: MagicMock,
|
|
||||||
input_value: str,
|
input_value: str,
|
||||||
error: bool,
|
error: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -872,11 +872,11 @@ def get_suggested(schema: vol.Schema, key: str) -> Any:
|
|||||||
return schema_key.description["suggested_value"]
|
return schema_key.description["suggested_value"]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("mock_reload_after_entry_update")
|
||||||
async def test_option_flow_default_suggested_values(
|
async def test_option_flow_default_suggested_values(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
mock_try_connection_success: MqttMockPahoClient,
|
mock_try_connection_success: MqttMockPahoClient,
|
||||||
mock_reload_after_entry_update: MagicMock,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test config flow options has default/suggested values."""
|
"""Test config flow options has default/suggested values."""
|
||||||
await mqtt_mock_entry()
|
await mqtt_mock_entry()
|
||||||
@ -1030,11 +1030,11 @@ async def test_option_flow_default_suggested_values(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("advanced_options", "step_id"), [(False, "options"), (True, "broker")]
|
("advanced_options", "step_id"), [(False, "options"), (True, "broker")]
|
||||||
)
|
)
|
||||||
|
@pytest.mark.usefixtures("mock_reload_after_entry_update")
|
||||||
async def test_skipping_advanced_options(
|
async def test_skipping_advanced_options(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_reload_after_entry_update: MagicMock,
|
|
||||||
advanced_options: bool,
|
advanced_options: bool,
|
||||||
step_id: str,
|
step_id: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1102,11 +1102,11 @@ async def test_skipping_advanced_options(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@pytest.mark.usefixtures("mock_reload_after_entry_update")
|
||||||
async def test_step_reauth(
|
async def test_step_reauth(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mqtt_client_mock: MqttMockPahoClient,
|
mqtt_client_mock: MqttMockPahoClient,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_reload_after_entry_update: MagicMock,
|
|
||||||
test_input: dict[str, Any],
|
test_input: dict[str, Any],
|
||||||
user_input: dict[str, Any],
|
user_input: dict[str, Any],
|
||||||
new_password: str,
|
new_password: str,
|
||||||
@ -1284,12 +1284,9 @@ async def test_options_bad_will_message_fails(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"hass_config", [{"mqtt": {"sensor": [{"state_topic": "some-topic"}]}}]
|
"hass_config", [{"mqtt": {"sensor": [{"state_topic": "some-topic"}]}}]
|
||||||
)
|
)
|
||||||
|
@pytest.mark.usefixtures("mock_ssl_context", "mock_process_uploaded_file")
|
||||||
async def test_try_connection_with_advanced_parameters(
|
async def test_try_connection_with_advanced_parameters(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mock_try_connection_success: MqttMockPahoClient
|
||||||
mock_try_connection_success: MqttMockPahoClient,
|
|
||||||
tmp_path: Path,
|
|
||||||
mock_ssl_context: dict[str, MagicMock],
|
|
||||||
mock_process_uploaded_file: MagicMock,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test config flow with advanced parameters from config."""
|
"""Test config flow with advanced parameters from config."""
|
||||||
config_entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
config_entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||||
@ -1402,10 +1399,10 @@ async def test_try_connection_with_advanced_parameters(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("mock_ssl_context")
|
||||||
async def test_setup_with_advanced_settings(
|
async def test_setup_with_advanced_settings(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_try_connection: MagicMock,
|
mock_try_connection: MagicMock,
|
||||||
mock_ssl_context: dict[str, MagicMock],
|
|
||||||
mock_process_uploaded_file: MagicMock,
|
mock_process_uploaded_file: MagicMock,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test config flow setup with advanced parameters."""
|
"""Test config flow setup with advanced parameters."""
|
||||||
@ -1564,11 +1561,9 @@ async def test_setup_with_advanced_settings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usesfixtures("mock_ssl_context", "mock_process_uploaded_file")
|
||||||
async def test_change_websockets_transport_to_tcp(
|
async def test_change_websockets_transport_to_tcp(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant, mock_try_connection: MagicMock
|
||||||
mock_try_connection,
|
|
||||||
mock_ssl_context: dict[str, MagicMock],
|
|
||||||
mock_process_uploaded_file: MagicMock,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test option flow setup with websockets transport settings."""
|
"""Test option flow setup with websockets transport settings."""
|
||||||
config_entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
config_entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user