MCPcopy
hub / github.com/openai/openai-python / test_copy_default_options

Method test_copy_default_options

tests/test_client.py:159–173  ·  view source on GitHub ↗
(self, client: OpenAI)

Source from the content-addressed store, hash-verified

157 assert client.admin_api_key == "My Admin API Key"
158
159 def test_copy_default_options(self, client: OpenAI) -> None:
160 # options that have a default are overridden correctly
161 copied = client.copy(max_retries=7)
162 assert copied.max_retries == 7
163 assert client.max_retries == 2
164
165 copied2 = copied.copy(max_retries=6)
166 assert copied2.max_retries == 6
167 assert copied.max_retries == 7
168
169 # timeout
170 assert isinstance(client.timeout, httpx.Timeout)
171 copied = client.copy(timeout=None)
172 assert copied.timeout is None
173 assert isinstance(client.timeout, httpx.Timeout)
174
175 def test_copy_default_headers(self) -> None:
176 client = OpenAI(

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected