mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
ci: install home-assistant-frontend (frontend dependency needs hass_frontend in tests); not_ready test registers WS commands directly
This commit is contained in:
@@ -40,6 +40,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with: { python-version: "3.13" }
|
with: { python-version: "3.13" }
|
||||||
- run: pip install pytest voluptuous pytest-homeassistant-custom-component
|
- run: pip install pytest voluptuous pytest-homeassistant-custom-component home-assistant-frontend
|
||||||
- name: Backend unit tests (pure + HA harness)
|
- name: Backend unit tests (pure + HA harness)
|
||||||
run: python -m pytest tests_backend/ -q
|
run: python -m pytest tests_backend/ -q
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ async def test_config_rev_conflict(hass: HomeAssistant, hass_ws_client: WebSocke
|
|||||||
|
|
||||||
async def test_not_ready_without_entry(hass: HomeAssistant, hass_ws_client: WebSocketGenerator) -> None:
|
async def test_not_ready_without_entry(hass: HomeAssistant, hass_ws_client: WebSocketGenerator) -> None:
|
||||||
"""WS commands answer not_ready when the integration has no loaded entry."""
|
"""WS commands answer not_ready when the integration has no loaded entry."""
|
||||||
# register commands without setting up an entry
|
# register only the WS commands, without an entry
|
||||||
from custom_components.houseplan import async_setup
|
from custom_components.houseplan import websocket_api as hp_ws
|
||||||
|
|
||||||
assert await async_setup(hass, {})
|
hp_ws.async_register(hass)
|
||||||
client = await hass_ws_client(hass)
|
client = await hass_ws_client(hass)
|
||||||
await client.send_json_auto_id({"type": "houseplan/layout/get"})
|
await client.send_json_auto_id({"type": "houseplan/layout/get"})
|
||||||
resp = await client.receive_json()
|
resp = await client.receive_json()
|
||||||
|
|||||||
Reference in New Issue
Block a user