Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct device_class test for mqtt button #101500

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/components/mqtt/test_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,19 +443,22 @@ async def test_entity_debug_info_message(
mqtt.DOMAIN: {
button.DOMAIN: {
"name": "test",
"state_topic": "test-topic",
"command_topic": "test-topic",
"device_class": "foobarnotreal",
}
}
}
],
)
async def test_invalid_device_class(
hass: HomeAssistant, mqtt_mock_entry: MqttMockHAClientGenerator
hass: HomeAssistant,
mqtt_mock_entry: MqttMockHAClientGenerator,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test device_class option with invalid value."""
with pytest.raises(AssertionError):
await mqtt_mock_entry()
assert "expected ButtonDeviceClass" in caplog.text


@pytest.mark.parametrize(
Expand Down