Skip to content

Commit c101e9a

Browse files
author
lxfight
committed
test: update plugin API tests to match pages field in list response
- test_plugin_get_excludes_scanned_pages: expect pages field now present - test_plugins: use name-based lookup instead of exact count assertion
1 parent ff990c6 commit c101e9a

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/test_dashboard.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,9 @@ async def test_plugin_get_excludes_scanned_pages(
855855
)
856856
assert plugin["activated"] is True
857857
assert "page" not in plugin
858-
assert "pages" not in plugin
858+
assert "pages" in plugin
859+
assert isinstance(plugin["pages"], list)
860+
assert PLUGIN_PAGE_DEMO_PAGE_NAME in plugin["pages"]
859861

860862

861863
@pytest.mark.asyncio
@@ -1433,9 +1435,14 @@ async def test_plugins(
14331435
assert response.status_code == 200
14341436
data = await response.get_json()
14351437
assert data["status"] == "ok"
1436-
assert len(data["data"]) == 1
1437-
assert "components" not in data["data"][0]
1438-
installed_at = data["data"][0]["installed_at"]
1438+
assert len(data["data"]) >= 1
1439+
target = next(
1440+
(item for item in data["data"] if item["name"] == test_plugin_name),
1441+
None,
1442+
)
1443+
assert target is not None
1444+
assert "components" not in target
1445+
installed_at = target["installed_at"]
14391446
assert installed_at is not None
14401447
datetime.fromisoformat(installed_at)
14411448

0 commit comments

Comments
 (0)