forked from sr2/cloud-api
tests: expanded assertions
New assertions added for new data being delivered (eg IDs on endpoints not previously serving IDs)
This commit is contained in:
parent
607f736453
commit
76e889d836
4 changed files with 110 additions and 35 deletions
|
|
@ -20,6 +20,7 @@ async def test_get_services_success(default_client: AsyncClient):
|
|||
|
||||
assert resp.status_code == 200
|
||||
assert "services" in data
|
||||
assert isinstance(data["services"], list)
|
||||
assert data["services"][0]["id"] == 1
|
||||
assert data["services"][0]["name"] == "Test Service"
|
||||
|
||||
|
|
@ -43,6 +44,7 @@ async def test_post_service_success(default_client: AsyncClient):
|
|||
|
||||
assert resp.status_code == 200
|
||||
assert "service" in data
|
||||
assert isinstance(data["service"], dict)
|
||||
assert data["service"]["name"] == "New Test Service"
|
||||
assert data["service"]["id"] == 2
|
||||
assert isinstance(data["service"]["api_key"], str)
|
||||
|
|
@ -72,6 +74,7 @@ async def test_patch_service_success(default_client: AsyncClient):
|
|||
|
||||
assert resp.status_code == 200
|
||||
assert "service" in data
|
||||
assert isinstance(data["service"], dict)
|
||||
assert data["service"]["name"] == "Test Service"
|
||||
assert data["service"]["id"] == 1
|
||||
assert isinstance(data["service"]["api_key"], str)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue