From 58361c6d3ae6ad5d5c7499817e742438cbefab97 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 11 Jan 2022 23:59:50 +0100 Subject: [PATCH] Fix string comparison issues with DeviceEntryType --- tests/components/deconz/test_gateway.py | 2 +- tests/components/picnic/test_sensor.py | 2 +- tests/helpers/test_device_registry.py | 2 +- tests/helpers/test_entity_platform.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/components/deconz/test_gateway.py b/tests/components/deconz/test_gateway.py index 30473814f264..c0e8b4b1704c 100644 --- a/tests/components/deconz/test_gateway.py +++ b/tests/components/deconz/test_gateway.py @@ -176,7 +176,7 @@ async def test_gateway_setup(hass, aioclient_mock): ) assert gateway_entry.configuration_url == f"http://{HOST}:{PORT}" - assert gateway_entry.entry_type is dr.DeviceEntryType.SERVICE + assert gateway_entry.entry_type == dr.DeviceEntryType.SERVICE async def test_gateway_device_configuration_url_when_addon(hass, aioclient_mock): diff --git a/tests/components/picnic/test_sensor.py b/tests/components/picnic/test_sensor.py index a4a52e50453e..638f5c80873b 100644 --- a/tests/components/picnic/test_sensor.py +++ b/tests/components/picnic/test_sensor.py @@ -434,7 +434,7 @@ async def test_device_registry_entry(self): ) assert picnic_service.model == DEFAULT_USER_RESPONSE["user_id"] assert picnic_service.name == "Picnic: Commonstreet 123a" - assert picnic_service.entry_type is DeviceEntryType.SERVICE + assert picnic_service.entry_type == DeviceEntryType.SERVICE async def test_auth_token_is_saved_on_update(self): """Test that auth-token changes in the session object are reflected by the config entry.""" diff --git a/tests/helpers/test_device_registry.py b/tests/helpers/test_device_registry.py index 0b6aa977f394..b0c0a1ea7c3f 100644 --- a/tests/helpers/test_device_registry.py +++ b/tests/helpers/test_device_registry.py @@ -217,7 +217,7 @@ async def test_loading_from_storage(hass, hass_storage): assert entry.area_id == "12345A" assert entry.name_by_user == "Test Friendly Name" assert entry.hw_version == "hw_version" - assert entry.entry_type is device_registry.DeviceEntryType.SERVICE + assert entry.entry_type == device_registry.DeviceEntryType.SERVICE assert entry.disabled_by == device_registry.DeviceEntryDisabler.USER assert isinstance(entry.config_entries, set) assert isinstance(entry.connections, set) diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 9aa0a849e5a8..41c846fbeaf2 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -864,7 +864,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): assert device.identifiers == {("hue", "1234")} assert device.configuration_url == "http://192.168.0.100/config" assert device.connections == {(dr.CONNECTION_NETWORK_MAC, "abcd")} - assert device.entry_type is dr.DeviceEntryType.SERVICE + assert device.entry_type == dr.DeviceEntryType.SERVICE assert device.manufacturer == "test-manuf" assert device.model == "test-model" assert device.name == "test-name"