mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Correct device_class test for mqtt button (#101500)
This commit is contained in:
parent
da770df13f
commit
2bfb1e75d3
@ -443,7 +443,7 @@ async def test_entity_debug_info_message(
|
|||||||
mqtt.DOMAIN: {
|
mqtt.DOMAIN: {
|
||||||
button.DOMAIN: {
|
button.DOMAIN: {
|
||||||
"name": "test",
|
"name": "test",
|
||||||
"state_topic": "test-topic",
|
"command_topic": "test-topic",
|
||||||
"device_class": "foobarnotreal",
|
"device_class": "foobarnotreal",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,11 +451,14 @@ async def test_entity_debug_info_message(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_invalid_device_class(
|
async def test_invalid_device_class(
|
||||||
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
|
hass: HomeAssistant,
|
||||||
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
|
caplog: pytest.LogCaptureFixture,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test device_class option with invalid value."""
|
"""Test device_class option with invalid value."""
|
||||||
with pytest.raises(AssertionError):
|
with pytest.raises(AssertionError):
|
||||||
await mqtt_mock_entry()
|
await mqtt_mock_entry()
|
||||||
|
assert "expected ButtonDeviceClass" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user