Home / Function/ test_request_extra_query() — anthropic-sdk-python Function Reference

test_request_extra_query() — anthropic-sdk-python Function Reference

Architecture documentation for the test_request_extra_query() function in test_client.py from the anthropic-sdk-python codebase.

Function python AnthropicClient AsyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  c4df7571_0ddb_0cb7_454d_79af1cb4b62d["test_request_extra_query()"]
  9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"]
  c4df7571_0ddb_0cb7_454d_79af1cb4b62d -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900
  00bcf638_2b7a_6229_4436_779751a9f9fc["test_request_extra_query()"]
  00bcf638_2b7a_6229_4436_779751a9f9fc -->|calls| c4df7571_0ddb_0cb7_454d_79af1cb4b62d
  00bcf638_2b7a_6229_4436_779751a9f9fc["test_request_extra_query()"]
  c4df7571_0ddb_0cb7_454d_79af1cb4b62d -->|calls| 00bcf638_2b7a_6229_4436_779751a9f9fc
  style c4df7571_0ddb_0cb7_454d_79af1cb4b62d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 1476–1515

    def test_request_extra_query(self, client: Anthropic) -> None:
        request = client._build_request(
            FinalRequestOptions(
                method="post",
                url="/foo",
                **make_request_options(
                    extra_query={"my_query_param": "Foo"},
                ),
            ),
        )
        params = dict(request.url.params)
        assert params == {"my_query_param": "Foo"}

        # if both `query` and `extra_query` are given, they are merged
        request = client._build_request(
            FinalRequestOptions(
                method="post",
                url="/foo",
                **make_request_options(
                    query={"bar": "1"},
                    extra_query={"foo": "2"},
                ),
            ),
        )
        params = dict(request.url.params)
        assert params == {"bar": "1", "foo": "2"}

        # `extra_query` takes priority over `query` when keys clash
        request = client._build_request(
            FinalRequestOptions(
                method="post",
                url="/foo",
                **make_request_options(
                    query={"foo": "1"},
                    extra_query={"foo": "2"},
                ),
            ),
        )
        params = dict(request.url.params)
        assert params == {"foo": "2"}

Subdomains

Frequently Asked Questions

What does test_request_extra_query() do?
test_request_extra_query() is a function in the anthropic-sdk-python codebase, defined in tests/test_client.py.
Where is test_request_extra_query() defined?
test_request_extra_query() is defined in tests/test_client.py at line 1476.
What does test_request_extra_query() call?
test_request_extra_query() calls 1 function(s): test_request_extra_query.
What calls test_request_extra_query()?
test_request_extra_query() is called by 1 function(s): test_request_extra_query.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free