summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/tests
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-11-07 02:01:32 +0000
committerClaude <noreply@anthropic.com>2026-11-07 02:01:32 +0000
commit68bbff79681c4054d1844e009ef4320405f8f035 (patch)
tree306720ae5aa5b0bc89898a946b5e145a13dd7566 /plugins/security-guidance/tests
parent3cb7a94734bd01ae7c977c87548fd4d235dcef19 (diff)
security-guidance: read blank and off variables as not set for the reviewer's tokenmhegazy/sg-reviewer-oauth-token
Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to 'plugins/security-guidance/tests')
-rw-r--r--plugins/security-guidance/tests/test_reviewer_oauth_token.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/security-guidance/tests/test_reviewer_oauth_token.py b/plugins/security-guidance/tests/test_reviewer_oauth_token.py
index 5014a37f..878608db 100644
--- a/plugins/security-guidance/tests/test_reviewer_oauth_token.py
+++ b/plugins/security-guidance/tests/test_reviewer_oauth_token.py
@@ -36,6 +36,13 @@ class TestReviewerOauthToken:
assert env["ANTHROPIC_AUTH_TOKEN"] == OAUTH_TOKEN
assert "CLAUDE_CODE_OAUTH_TOKEN" not in env
+ @pytest.mark.parametrize("name, value", [
+ ("ANTHROPIC_BASE_URL", ""), ("ANTHROPIC_BASE_URL", " "),
+ ("CLAUDE_CODE_SIMPLE", "0"), ("CLAUDE_CODE_REMOTE", "0"), ("CLAUDE_CODE_REMOTE", "false")])
+ def test_blank_or_off_counts_as_not_set(self, monkeypatch, name, value):
+ env = _spawn_env(monkeypatch, ANTHROPIC_AUTH_TOKEN=OAUTH_TOKEN, **{name: value})
+ assert env["CLAUDE_CODE_OAUTH_TOKEN"] == OAUTH_TOKEN
+
def test_api_key_wins_over_a_claude_ai_token(self, monkeypatch):
env = _spawn_env(monkeypatch, ANTHROPIC_API_KEY="key", ANTHROPIC_AUTH_TOKEN=OAUTH_TOKEN)
assert env["ANTHROPIC_AUTH_TOKEN"] == ""