Assert retry_after propagation in teslemetry coordinator retry tests (#181721)

This commit is contained in:
Brett Adams
2026-09-12 22:29:13 +02:00
committed by GitHub
parent 49c7a9e606
commit 0a6bcdb773
+13
View File
@@ -4,6 +4,7 @@ import asyncio
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from copy import deepcopy
from datetime import timedelta
import logging
import time
from types import MappingProxyType
@@ -686,6 +687,18 @@ async def test_energy_history_coordinator_retry_exceptions(
# Entry stays loaded - UpdateFailed with retry_after doesn't break the entry
assert entry.state is ConfigEntryState.LOADED
# The coordinator staggers its scheduling deliberately, so these ticks
# bracket retry_after with a margin either side rather than sitting on it.
freezer.tick(timedelta(seconds=expected_retry_after - 2))
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert call_count == 1
freezer.tick(timedelta(seconds=3))
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert call_count == 2
async def test_live_status_auth_error(
hass: HomeAssistant,