1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Improve stability for unrelated test

This commit is contained in:
Daniel Vikström
2025-04-14 21:36:50 +02:00
parent 9c4aa0ba53
commit 3922950951

View File

@@ -75,6 +75,9 @@ async def test_devices_page(dashboard: DashboardTestHelper) -> None:
assert response.headers["content-type"] == "application/json"
json_data = json.loads(response.body.decode())
configured_devices = json_data["configured"]
first_device = configured_devices[0]
assert first_device["name"] == "pico"
assert first_device["configuration"] == "pico.yaml"
if len(configured_devices) == 0:
assert len(configured_devices) != 0
else:
first_device = configured_devices[0]
assert first_device["name"] == "pico"
assert first_device["configuration"] == "pico.yaml"