From 7a477074f5099fb2da8ecd5f5d16c11301c72d45 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 17:52:38 +0000 Subject: tests: add valid-token passthrough test for case-attribute edit --- tests/test_gn3_auth_flow.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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()}" + ) -- cgit 1.4.1