mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 12:16:29 +00:00
Avoid using host system socket for logs tests (#5825)
Make sure we mock the systemd journal gateway socket for tests. This makes the test work on systems which have systemd-journal-gatewayd installed.
This commit is contained in:
parent
f7317134e3
commit
6fad7d14e1
@ -355,11 +355,11 @@ async def test_advanced_logs_formatters(
|
|||||||
journal_logs_reader.assert_called_once_with(ANY, LogFormatter.VERBOSE)
|
journal_logs_reader.assert_called_once_with(ANY, LogFormatter.VERBOSE)
|
||||||
|
|
||||||
|
|
||||||
async def test_advanced_logs_errors(api_client: TestClient):
|
async def test_advanced_logs_errors(coresys: CoreSys, api_client: TestClient):
|
||||||
"""Test advanced logging API errors."""
|
"""Test advanced logging API errors."""
|
||||||
# coresys = coresys_logs_control
|
|
||||||
with patch("supervisor.host.logs.SYSTEMD_JOURNAL_GATEWAYD_SOCKET") as socket:
|
with patch("supervisor.host.logs.SYSTEMD_JOURNAL_GATEWAYD_SOCKET") as socket:
|
||||||
socket.is_socket.return_value = False
|
socket.is_socket.return_value = False
|
||||||
|
await coresys.host.logs.post_init()
|
||||||
resp = await api_client.get("/host/logs")
|
resp = await api_client.get("/host/logs")
|
||||||
assert resp.content_type == "text/plain"
|
assert resp.content_type == "text/plain"
|
||||||
assert resp.status == 400
|
assert resp.status == 400
|
||||||
|
Loading…
x
Reference in New Issue
Block a user