From 2bfb1e75d32d9a4b2238a556fc20cbd50fbce36c Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Fri, 6 Oct 2023 09:11:50 +0200 Subject: [PATCH] Correct device_class test for mqtt button (#101500) --- tests/components/mqtt/test_button.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/components/mqtt/test_button.py b/tests/components/mqtt/test_button.py index 481e98f0099..35b6561895d 100644 --- a/tests/components/mqtt/test_button.py +++ b/tests/components/mqtt/test_button.py @@ -443,7 +443,7 @@ async def test_entity_debug_info_message( mqtt.DOMAIN: { button.DOMAIN: { "name": "test", - "state_topic": "test-topic", + "command_topic": "test-topic", "device_class": "foobarnotreal", } } @@ -451,11 +451,14 @@ async def test_entity_debug_info_message( ], ) 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(