1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-25 04:46:25 +00:00

Add blockbuster library and find I/O from unit tests (#5731)

* Add blockbuster library and find I/O from unit tests

* Fix lint and test issue

* Fixes from feedback

* Avoid modifying webapp object in executor

* Split su options validation and only validate timezone on change
This commit is contained in:
Mike Degatano
2025-03-06 16:40:13 -05:00
committed by GitHub
parent 1fb4d1cc11
commit 6ef4f3cc67
45 changed files with 374 additions and 151 deletions

View File

@@ -33,7 +33,7 @@ async def test_load(coresys: CoreSys):
assert identifier in coresys.host.logs.default_identifiers
async def test_logs(coresys: CoreSys, journald_gateway: MagicMock):
async def test_logs(journald_gateway: MagicMock, coresys: CoreSys):
"""Test getting logs and errors."""
assert coresys.host.logs.available is True
@@ -63,7 +63,7 @@ async def test_logs(coresys: CoreSys, journald_gateway: MagicMock):
pass
async def test_logs_coloured(coresys: CoreSys, journald_gateway: MagicMock):
async def test_logs_coloured(journald_gateway: MagicMock, coresys: CoreSys):
"""Test ANSI control sequences being preserved in binary messages."""
journald_gateway.content.feed_data(
load_fixture("logs_export_supervisor.txt").encode("utf-8")
@@ -82,7 +82,7 @@ async def test_logs_coloured(coresys: CoreSys, journald_gateway: MagicMock):
)
async def test_boot_ids(coresys: CoreSys, journald_gateway: MagicMock):
async def test_boot_ids(journald_gateway: MagicMock, coresys: CoreSys):
"""Test getting boot ids."""
journald_gateway.content.feed_data(
load_fixture("logs_boot_ids.txt").encode("utf-8")
@@ -109,7 +109,7 @@ async def test_boot_ids(coresys: CoreSys, journald_gateway: MagicMock):
await coresys.host.logs.get_boot_id(3)
async def test_boot_ids_fallback(coresys: CoreSys, journald_gateway: MagicMock):
async def test_boot_ids_fallback(journald_gateway: MagicMock, coresys: CoreSys):
"""Test getting boot ids using fallback."""
# Initial response has no log lines
journald_gateway.content.feed_data(b"")
@@ -134,7 +134,7 @@ async def test_boot_ids_fallback(coresys: CoreSys, journald_gateway: MagicMock):
]
async def test_identifiers(coresys: CoreSys, journald_gateway: MagicMock):
async def test_identifiers(journald_gateway: MagicMock, coresys: CoreSys):
"""Test getting identifiers."""
journald_gateway.content.feed_data(
load_fixture("logs_identifiers.txt").encode("utf-8")
@@ -156,7 +156,7 @@ async def test_identifiers(coresys: CoreSys, journald_gateway: MagicMock):
async def test_connection_refused_handled(
coresys: CoreSys, journald_gateway: MagicMock
journald_gateway: MagicMock, coresys: CoreSys
):
"""Test connection refused is handled with HostServiceError."""
with patch("supervisor.host.logs.ClientSession.get") as get: