From 2c36a74da5ef4bc82587df843efa7a31da775661 Mon Sep 17 00:00:00 2001 From: Yuxin Wang Date: Sat, 9 Aug 2025 19:49:25 -1000 Subject: [PATCH] Also test unique ID in config flow test for APCUPSD (#150362) --- homeassistant/components/apcupsd/quality_scale.yaml | 1 - tests/components/apcupsd/test_config_flow.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/apcupsd/quality_scale.yaml b/homeassistant/components/apcupsd/quality_scale.yaml index 18fc15cd614..f6fd7e0c2d3 100644 --- a/homeassistant/components/apcupsd/quality_scale.yaml +++ b/homeassistant/components/apcupsd/quality_scale.yaml @@ -13,7 +13,6 @@ rules: Consider looking into making a `mock_setup_entry` fixture that just automatically do this. `test_config_flow_cannot_connect`: Needs to end in CREATE_ENTRY to test that its able to recover. `test_config_flow_duplicate`: this test should be split in 2, one for testing duplicate host/port and one for duplicate serial number. - `test_flow_works`: Should also test unique id. config-flow: done dependency-transparency: done docs-actions: diff --git a/tests/components/apcupsd/test_config_flow.py b/tests/components/apcupsd/test_config_flow.py index e635b7d6681..6263b5646e5 100644 --- a/tests/components/apcupsd/test_config_flow.py +++ b/tests/components/apcupsd/test_config_flow.py @@ -123,6 +123,7 @@ async def test_flow_works(hass: HomeAssistant) -> None: assert result["type"] is FlowResultType.CREATE_ENTRY assert result["title"] == MOCK_STATUS["UPSNAME"] assert result["data"] == CONF_DATA + assert result["result"].unique_id == MOCK_STATUS["SERIALNO"] mock_setup.assert_called_once()