From c0b97636691528b43d5d31072531a5769a56bcbe Mon Sep 17 00:00:00 2001 From: luxferre Date: Fri, 12 Jun 2026 13:01:04 +0100 Subject: [PATCH] tests: caor status checks match new model Issue: #24 --- test/test_iam.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_iam.py b/test/test_iam.py index d879b26..5bdcc07 100644 --- a/test/test_iam.py +++ b/test/test_iam.py @@ -92,19 +92,24 @@ async def test_act_on_resource_missing_key(default_client: AsyncClient): ("Test Service", 42, "test_resource", "read", 422), ("Test Service", "Test Org", None, "read", 422), ("Test Service", "Test Org", 42, "read", 422), + ("Test Service", "Test Org", "test_resource", None, 422), + ("Test Service", "Test Org", "test_resource", 42, 422), ], ) @pytest.mark.anyio async def test_act_on_resource_endpoint_status_checks( default_client: AsyncClient, service, org, resource, action, expected_status: int ): - body = {"service": service, "organisation": org, "resource": resource} + body = { + "rn": {"service": service, "organisation": org, "resource": resource}, + "action": action, + } headers = { "Authorization": "Bearer not_checked_when_auth_is_disabled", "X-API-Key": "123456789", } resp = await default_client.post( - f"/iam/can_act_on_resource?action={action}", json=body, headers=headers + "/iam/can_act_on_resource", json=body, headers=headers ) assert resp.status_code == expected_status