tests/minor: rename test functions
`_failure` in name wasn't necessarily an accurate descriptor for parameterized testing with expected statuses. `_status_checks` used instead.
This commit is contained in:
parent
f600664789
commit
b8b39188f6
4 changed files with 24 additions and 25 deletions
|
|
@ -1,5 +1,4 @@
|
|||
"""
|
||||
Act on resource tests only check for pass/fail on input validation. Logic is not tested.
|
||||
"""
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
|
@ -83,7 +82,7 @@ async def test_act_on_resource_missing_key(default_client: AsyncClient):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_act_on_resource_endpoint_failure(default_client: AsyncClient, service, org, resource, action,
|
||||
async def test_act_on_resource_endpoint_status_checks(default_client: AsyncClient, service, org, resource, action,
|
||||
expected_status: int):
|
||||
body = {
|
||||
"service": service,
|
||||
|
|
@ -160,7 +159,7 @@ async def test_get_group_permissions_success(default_client: AsyncClient):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_get_group_permissions_failure(default_client: AsyncClient, db_session, query: str, expected_status: int):
|
||||
async def test_get_group_permissions_status_checks(default_client: AsyncClient, db_session, query: str, expected_status: int):
|
||||
resp = await default_client.get(f"/iam/group/permissions?{query}")
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -216,7 +215,7 @@ async def test_get_group_users_success(default_client: AsyncClient):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_get_group_users_failure(default_client: AsyncClient, query: str, expected_status: int):
|
||||
async def test_get_group_users_status_checks(default_client: AsyncClient, query: str, expected_status: int):
|
||||
resp = await default_client.get(f"/iam/group/users?{query}")
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -269,7 +268,7 @@ async def test_post_group_success(default_client: AsyncClient):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_post_group_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
async def test_post_group_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
resp = await default_client.post("/iam/group", json=body)
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -327,7 +326,7 @@ async def test_put_group_perm_success(default_client: AsyncClient, db_session):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_put_group_perm_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
async def test_put_group_perm_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
resp = await default_client.put("/iam/group/permission", json=body)
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -403,7 +402,7 @@ async def test_put_group_user_success(default_client: AsyncClient, db_session):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_put_group_user_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
async def test_put_group_user_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
resp = await default_client.put("/iam/group/user", json=body)
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -433,7 +432,7 @@ async def test_get_permissions_success(default_client: AsyncClient):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_get_permissions_failure(default_client: AsyncClient, query: str, expected_status: int):
|
||||
async def test_get_permissions_status_checks(default_client: AsyncClient, query: str, expected_status: int):
|
||||
resp = await default_client.get(f"/iam/permissions?{query}")
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -479,7 +478,7 @@ async def test_post_perm_success(default_client: AsyncClient, db_session):
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_post_perm_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
async def test_post_perm_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
resp = await default_client.post("/iam/permission", json=body)
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
@ -536,7 +535,7 @@ async def test_post_perm_search_success(default_client: AsyncClient, db_session,
|
|||
],
|
||||
)
|
||||
@pytest.mark.anyio
|
||||
async def test_post_perm_search_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
async def test_post_perm_search_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
|
||||
resp = await default_client.post("/iam/permissions/search", json=body)
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue