MCPcopy Index your code
hub / github.com/openai/openai-python / test_copy_auth

Method test_copy_auth

tests/test_client.py:1381–1386  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1379 assert calls[1].request.headers.get("Authorization") == "Bearer second"
1380
1381 def test_copy_auth(self) -> None:
1382 client = OpenAI(base_url=base_url, api_key=lambda: "test_bearer_token_1").copy(
1383 api_key=lambda: "test_bearer_token_2"
1384 )
1385 client._refresh_api_key()
1386 assert client.auth_headers == {"Authorization": "Bearer test_bearer_token_2"}
1387
1388
1389class TestAsyncOpenAI:

Callers

nothing calls this directly

Calls 3

OpenAIClass · 0.90
copyMethod · 0.45
_refresh_api_keyMethod · 0.45

Tested by

no test coverage detected