1
0
Fork 0
forked from sr2/cloud-api

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:
Chris Milne 2026-06-05 09:22:44 +01:00
parent f600664789
commit b8b39188f6
4 changed files with 24 additions and 25 deletions

View file

@ -32,7 +32,7 @@ async def test_get_org_success(default_client: AsyncClient):
],
)
@pytest.mark.anyio
async def test_get_org_failure(default_client: AsyncClient, query: str, expected_status: int):
async def test_get_org_status_checks(default_client: AsyncClient, query: str, expected_status: int):
resp = await default_client.get(f"/org?{query}")
assert resp.status_code == expected_status
@ -57,7 +57,7 @@ async def test_post_org_success(default_client: AsyncClient):
],
)
@pytest.mark.anyio
async def test_post_org_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
async def test_post_org_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
resp = await default_client.post("/org", json=body)
assert resp.status_code == expected_status
@ -93,7 +93,7 @@ async def test_patch_org_questionnaire_partial_success(default_client: AsyncClie
],
)
@pytest.mark.anyio
async def test_patch_questionnaire_partial_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
async def test_patch_questionnaire_partial_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
resp = await default_client.patch("/org/questionnaire", json=body)
assert resp.status_code == expected_status
@ -142,7 +142,7 @@ async def test_patch_org_status_success(default_client: AsyncClient, status: str
],
)
@pytest.mark.anyio
async def test_patch_org_status_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
async def test_patch_org_status_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
resp = await default_client.patch("/org/status", json=body)
assert resp.status_code == expected_status
@ -173,7 +173,7 @@ async def test_get_org_users_success(default_client: AsyncClient):
],
)
@pytest.mark.anyio
async def test_get_org_users_failure(default_client: AsyncClient, query: str, expected_status: int):
async def test_get_org_users_status_checks(default_client: AsyncClient, query: str, expected_status: int):
resp = await default_client.get(f"/org/users?{query}")
assert resp.status_code == expected_status
@ -205,7 +205,7 @@ async def test_post_org_user_success(default_client: AsyncClient, db_session):
],
)
@pytest.mark.anyio
async def test_post_org_user_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int, db_session):
async def test_post_org_user_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int, db_session):
db_session.add(User(email="user@test.org", first_name="User", last_name="Test", oidc_id="abcd-efgh-ijkl-1234"))
db_session.flush()
@ -242,7 +242,7 @@ async def test_patch_org_root_user_success(default_client: AsyncClient, db_sessi
],
)
@pytest.mark.anyio
async def test_patch_root_user_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int, db_session):
async def test_patch_root_user_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int, db_session):
db_session.add(User(email="user@test.org", first_name="User", last_name="Test", oidc_id="abcd-efgh-ijkl-1234"))
db_session.flush()
db_session.add(OrgUsers(org_id=1, user_id=2))
@ -285,7 +285,7 @@ async def test_get_org_groups_success(default_client: AsyncClient):
],
)
@pytest.mark.anyio
async def test_get_org_groups_failure(default_client: AsyncClient, query: str, expected_status: int):
async def test_get_org_groups_status_checks(default_client: AsyncClient, query: str, expected_status: int):
resp = await default_client.get(f"/org/groups?{query}")
assert resp.status_code == expected_status
@ -339,7 +339,7 @@ async def test_get_org_contact_success(default_client: AsyncClient, contact_type
],
)
@pytest.mark.anyio
async def test_get_org_contact_failure(default_client: AsyncClient, query: str, expected_status: int):
async def test_get_org_contact_status_checks(default_client: AsyncClient, query: str, expected_status: int):
resp = await default_client.get(f"/org/contact?{query}")
assert resp.status_code == expected_status
@ -391,7 +391,7 @@ async def test_patch_org_contact_success(default_client: AsyncClient, key: str,
],
)
@pytest.mark.anyio
async def test_patch_org_status_failure(default_client: AsyncClient, body: dict[str, str], expected_status: int):
async def test_patch_org_status_status_checks(default_client: AsyncClient, body: dict[str, str], expected_status: int):
resp = await default_client.patch("/org/contact", json=body)
assert resp.status_code == expected_status