mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Prepare MQTT common tests part4 (#90023)
* Upd test_setting_attribute_via_mqtt_json_message * Update test_setting_attribute_with_template * Update test_update_with_json_attrs_not_dict * Update test_update_with_json_attrs_bad_json
This commit is contained in:
@ -1921,11 +1921,11 @@ async def test_custom_availability_payload(
|
||||
|
||||
|
||||
async def test_setting_attribute_via_mqtt_json_message(
|
||||
hass: HomeAssistant, mqtt_mock_entry_with_yaml_config: MqttMockHAClientGenerator
|
||||
hass: HomeAssistant, mqtt_mock_entry_no_yaml_config: MqttMockHAClientGenerator
|
||||
) -> None:
|
||||
"""Test the setting of attribute via MQTT with JSON payload."""
|
||||
await help_test_setting_attribute_via_mqtt_json_message(
|
||||
hass, mqtt_mock_entry_with_yaml_config, light.DOMAIN, DEFAULT_CONFIG
|
||||
hass, mqtt_mock_entry_no_yaml_config, light.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
@ -1943,23 +1943,23 @@ async def test_setting_blocked_attribute_via_mqtt_json_message(
|
||||
|
||||
|
||||
async def test_setting_attribute_with_template(
|
||||
hass: HomeAssistant, mqtt_mock_entry_with_yaml_config: MqttMockHAClientGenerator
|
||||
hass: HomeAssistant, mqtt_mock_entry_no_yaml_config: MqttMockHAClientGenerator
|
||||
) -> None:
|
||||
"""Test the setting of attribute via MQTT with JSON payload."""
|
||||
await help_test_setting_attribute_with_template(
|
||||
hass, mqtt_mock_entry_with_yaml_config, light.DOMAIN, DEFAULT_CONFIG
|
||||
hass, mqtt_mock_entry_no_yaml_config, light.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
async def test_update_with_json_attrs_not_dict(
|
||||
hass: HomeAssistant,
|
||||
mqtt_mock_entry_with_yaml_config: MqttMockHAClientGenerator,
|
||||
mqtt_mock_entry_no_yaml_config: MqttMockHAClientGenerator,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Test attributes get extracted from a JSON result."""
|
||||
await help_test_update_with_json_attrs_not_dict(
|
||||
hass,
|
||||
mqtt_mock_entry_with_yaml_config,
|
||||
mqtt_mock_entry_no_yaml_config,
|
||||
caplog,
|
||||
light.DOMAIN,
|
||||
DEFAULT_CONFIG,
|
||||
@ -1968,13 +1968,13 @@ async def test_update_with_json_attrs_not_dict(
|
||||
|
||||
async def test_update_with_json_attrs_bad_json(
|
||||
hass: HomeAssistant,
|
||||
mqtt_mock_entry_with_yaml_config: MqttMockHAClientGenerator,
|
||||
mqtt_mock_entry_no_yaml_config: MqttMockHAClientGenerator,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Test attributes get extracted from a JSON result."""
|
||||
await help_test_update_with_json_attrs_bad_json(
|
||||
hass,
|
||||
mqtt_mock_entry_with_yaml_config,
|
||||
mqtt_mock_entry_no_yaml_config,
|
||||
caplog,
|
||||
light.DOMAIN,
|
||||
DEFAULT_CONFIG,
|
||||
|
Reference in New Issue
Block a user