address greptile review feedback (greploop iteration 41)

- add Bearer token header assertion to test_pkce_token_exchange_credentials_in_body
- add cache query assertions to both non-strict mode tests to confirm
  the cache was accessed before the warning path triggers
This commit is contained in:
Ishaan Jaffer 2026-03-06 15:01:20 -08:00
parent 427d013d8c
commit 2c268bc22d

View file

@ -3517,6 +3517,10 @@ class TestPKCEFunctionality:
assert result["access_token"] == "tok_body"
assert result["sub"] == "user2"
# Verify userinfo GET used the correct Bearer token header
get_call = mock_userinfo_client.get.call_args
assert get_call is not None
assert get_call.kwargs["headers"]["Authorization"] == "Bearer tok_body"
@pytest.mark.asyncio
@ -3817,6 +3821,8 @@ class TestPKCEFunctionality:
# Should return params without code_verifier (no raise)
assert "code_verifier" not in result
assert "_pkce_cache_key" not in result
# Non-strict mode emits a warning rather than raising
mock_cache.async_get_cache.assert_called_once()
@pytest.mark.asyncio
async def test_pkce_token_exchange_non200_raises_proxy_exception(self):
@ -3890,6 +3896,8 @@ class TestPKCEFunctionality:
# No raise in non-strict mode; verifier simply absent from params
assert "code_verifier" not in result
assert "_pkce_cache_key" not in result
# Cache was queried (the unexpected format was retrieved and logged at WARNING)
mock_cache.async_get_cache.assert_called_once()
@pytest.mark.asyncio
async def test_pkce_legacy_string_cache_format_backward_compat(self):