diff options
| -rw-r--r-- | tests/test_gn3_auth_flow.py | 16 |
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()}" + ) |
