mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix lingering hassio issues test (#113569)
This commit is contained in:
parent
b26928878f
commit
6e84dbde35
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
from datetime import timedelta
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest.mock import ANY, patch
|
from unittest.mock import ANY, patch
|
||||||
|
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.repairs import DOMAIN as REPAIRS_DOMAIN
|
from homeassistant.components.repairs import DOMAIN as REPAIRS_DOMAIN
|
||||||
@ -536,6 +537,7 @@ async def test_supervisor_issues_initial_failure(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
aioclient_mock: AiohttpClientMocker,
|
aioclient_mock: AiohttpClientMocker,
|
||||||
hass_ws_client: WebSocketGenerator,
|
hass_ws_client: WebSocketGenerator,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test issues manager retries after initial update failure."""
|
"""Test issues manager retries after initial update failure."""
|
||||||
responses = [
|
responses = [
|
||||||
@ -600,7 +602,8 @@ async def test_supervisor_issues_initial_failure(
|
|||||||
assert msg["success"]
|
assert msg["success"]
|
||||||
assert len(msg["result"]["issues"]) == 0
|
assert len(msg["result"]["issues"]) == 0
|
||||||
|
|
||||||
await asyncio.sleep(0.1)
|
freezer.tick(timedelta(milliseconds=200))
|
||||||
|
await hass.async_block_till_done()
|
||||||
await client.send_json({"id": 2, "type": "repairs/list_issues"})
|
await client.send_json({"id": 2, "type": "repairs/list_issues"})
|
||||||
msg = await client.receive_json()
|
msg = await client.receive_json()
|
||||||
assert msg["success"]
|
assert msg["success"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user