test_default_headers_option() — anthropic-sdk-python Function Reference
Architecture documentation for the test_default_headers_option() function in test_client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 36086efe_424b_0d95_82b3_f6464b5b786f["test_default_headers_option()"] 9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"] 36086efe_424b_0d95_82b3_f6464b5b786f -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900 f7ed3ab5_ea7f_8f06_dbd8_dd621f298f75["test_default_headers_option()"] f7ed3ab5_ea7f_8f06_dbd8_dd621f298f75 -->|calls| 36086efe_424b_0d95_82b3_f6464b5b786f f7ed3ab5_ea7f_8f06_dbd8_dd621f298f75["test_default_headers_option()"] 36086efe_424b_0d95_82b3_f6464b5b786f -->|calls| f7ed3ab5_ea7f_8f06_dbd8_dd621f298f75 style 36086efe_424b_0d95_82b3_f6464b5b786f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_client.py lines 1359–1381
async def test_default_headers_option(self) -> None:
test_client = AsyncAnthropic(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
request = test_client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-stainless-lang") == "python"
test_client2 = AsyncAnthropic(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
default_headers={
"X-Foo": "stainless",
"X-Stainless-Lang": "my-overriding-header",
},
)
request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
await test_client.close()
await test_client2.close()
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does test_default_headers_option() do?
test_default_headers_option() is a function in the anthropic-sdk-python codebase, defined in tests/test_client.py.
Where is test_default_headers_option() defined?
test_default_headers_option() is defined in tests/test_client.py at line 1359.
What does test_default_headers_option() call?
test_default_headers_option() calls 1 function(s): test_default_headers_option.
What calls test_default_headers_option()?
test_default_headers_option() is called by 1 function(s): test_default_headers_option.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free