about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaude2026-06-26 17:52:38 +0000
committerFrederick Muriuki Muriithi2026-06-26 12:56:21 -0500
commit7a477074f5099fb2da8ecd5f5d16c11301c72d45 (patch)
tree6f23a6143ff41e99e67a7099f098ab7a9c15a7b2
parent4621c53e6ae8f7abb2aafd0a71bf375d1064d275 (diff)
downloadgn-integration-tests-7a477074f5099fb2da8ecd5f5d16c11301c72d45.tar.gz
tests: add valid-token passthrough test for case-attribute edit
-rw-r--r--tests/test_gn3_auth_flow.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_gn3_auth_flow.py b/tests/test_gn3_auth_flow.py
index 47e4ff9..67ca4dd 100644
--- a/tests/test_gn3_auth_flow.py
+++ b/tests/test_gn3_auth_flow.py
@@ -182,3 +182,19 @@ def test_reject_invalid_token_error_is_token_validation_error(gn3_url, http):
     assert resp.json().get("error") == "TokenValidationError", (
         f"Expected error='TokenValidationError', got: {resp.json()}"
     )
+
+
+def test_edit_valid_token_is_not_rejected_by_auth(gn3_url, http, access_token):
+    """Valid token reaches the endpoint handler; response is not TokenValidationError.
+
+    Requires live auth credentials (set by the CI test-session lifecycle).
+    """
+    resp = http.post(
+        f"{gn3_url}/case-attribute/{_INBREDSET_ID}/edit",
+        json={"edit-data": []},
+        headers={"Authorization": f"Bearer {access_token}"},
+        timeout=30,
+    )
+    assert resp.json().get("error") != "TokenValidationError", (
+        f"Valid token should not be rejected by @require_token, got: {resp.json()}"
+    )