Fix use of issue registry in anglian water (#177350)

This commit is contained in:
Josef Zweck
2026-07-27 09:27:13 +02:00
committed by GitHub
parent 2d3b4cb617
commit 7d37916a8e
2 changed files with 4 additions and 6 deletions
@@ -301,6 +301,7 @@ async def test_coordinator_update_failed_errors(
async def test_coordinator_consent_required_error(
recorder_mock: Recorder,
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
mock_config_entry: MockConfigEntry,
mock_anglian_water_client: AsyncMock,
) -> None:
@@ -316,15 +317,12 @@ async def test_coordinator_consent_required_error(
assert exc_info.value.translation_domain == DOMAIN
assert exc_info.value.translation_key == "consent_required"
assert exc_info.value.retry_after == 900.0
assert (
ir.async_get(hass).async_get_issue(DOMAIN, CONSENT_REQUIRED_ISSUE_ID)
is not None
)
assert issue_registry.async_get_issue(DOMAIN, CONSENT_REQUIRED_ISSUE_ID) is not None
mock_anglian_water_client.update.side_effect = None
await coordinator._async_update_data()
await async_wait_recording_done(hass)
assert ir.async_get(hass).async_get_issue(DOMAIN, CONSENT_REQUIRED_ISSUE_ID) is None
assert issue_registry.async_get_issue(DOMAIN, CONSENT_REQUIRED_ISSUE_ID) is None
@pytest.mark.parametrize(
+1 -1
View File
@@ -83,6 +83,7 @@ async def test_setup_auth_failures(
async def test_setup_consent_required(
recorder_mock: Recorder,
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
mock_config_entry: MockConfigEntry,
mock_anglian_water_client: AsyncMock,
mock_anglian_water_authenticator: MagicMock,
@@ -98,7 +99,6 @@ async def test_setup_consent_required(
assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY
issue_registry = ir.async_get(hass)
assert issue_registry.async_get_issue(DOMAIN, CONSENT_REQUIRED_ISSUE_ID) is not None
# Test that the issue is deleted once consent is granted