fix(python): expect oidc credential-type header on refreshed tokens (#4632)

## Summary

#3971 added `test_zero_lifetime_token_is_refreshed`, but its expected
headers omit `x-lancedb-credential-type: oidc`, which
`OAuthProvider.get_headers()` has emitted since #2631/#4070. The test
fails against current main and breaks the PR CI matrix for every open
PR.

## Changes

- Align the two zap assertions in
`test_zero_lifetime_token_is_refreshed` with the provider contract (see
`test_token_refresh` and `test_sync_method`).

## Tests

- `pytest python/tests/test_header_provider.py -q`
This commit is contained in:
Xuanwo
2026-10-23 02:19:32 +08:00
committed by GitHub
parent 7f932b8552
commit 62d83f2ea2
+8 -2
View File
@@ -128,8 +128,14 @@ class TestOAuthProvider:
provider = OAuthProvider(fetcher, refresh_buffer_seconds=0)
assert provider.get_headers() == {"Authorization": "Bearer token1"}
assert provider.get_headers() == {"Authorization": "Bearer token2"}
assert provider.get_headers() == {
"Authorization": "Bearer token1",
"x-lancedb-credential-type": "oidc",
}
assert provider.get_headers() == {
"Authorization": "Bearer token2",
"x-lancedb-credential-type": "oidc",
}
assert call_count == 2
def test_missing_access_token(self):