mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-06 00:36:28 +00:00

* 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
24 lines
702 B
Python
24 lines
702 B
Python
"""Test panel API."""
|
|
|
|
from pathlib import Path
|
|
|
|
from aiohttp.test_utils import TestClient
|
|
import pytest
|
|
|
|
from supervisor.coresys import CoreSys
|
|
|
|
PANEL_PATH = Path(__file__).parent.parent.parent.joinpath("supervisor/api/panel")
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"filename", ["entrypoint.js", "entrypoint.js.br", "entrypoint.js.gz"]
|
|
)
|
|
async def test_frontend_files(api_client: TestClient, coresys: CoreSys, filename: str):
|
|
"""Test frontend files served up correctly."""
|
|
resp = await api_client.get(f"/app/{filename}")
|
|
assert resp.status == 200
|
|
|
|
body = await resp.read()
|
|
file_bytes = await coresys.run_in_executor(PANEL_PATH.joinpath(filename).read_bytes)
|
|
assert body == file_bytes
|