Skip to content

Commit 2b06d70

Browse files
test: cover admin dashboard (#23)
1 parent 3965b29 commit 2b06d70

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎tests/test_sdk.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,23 @@ def test_rollback(self, client, httpx_mock: HTTPXMock):
497497
assert result["rolled_back_to"] == 1
498498

499499

500+
class TestAdminDashboard:
501+
def test_get_dashboard(self, client, httpx_mock: HTTPXMock):
502+
httpx_mock.add_response(
503+
method="GET",
504+
url=f"{BASE_URL}/admin/dashboard",
505+
json={
506+
"providers": {"enabled": 3, "disabled": 1},
507+
"keys": {"active": 5, "revoked": 2},
508+
"requests": {"total": 128, "errors": 4},
509+
},
510+
)
511+
dashboard = client.admin.dashboard()
512+
assert dashboard["providers"]["enabled"] == 3
513+
assert dashboard["keys"]["active"] == 5
514+
assert dashboard["requests"]["total"] == 128
515+
516+
500517
class TestAdminLogs:
501518
def test_list_logs(self, client, httpx_mock: HTTPXMock):
502519
httpx_mock.add_response(

0 commit comments

Comments
 (0)