test_basic_response() — anthropic-sdk-python Function Reference
Architecture documentation for the test_basic_response() function in test_beta_messages.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 064593f6_700d_3df3_7fc7_30ff32de9e12["test_basic_response()"] 2e8dda61_2812_b278_9fde_2756aae18380["TestSyncMessages"] 064593f6_700d_3df3_7fc7_30ff32de9e12 -->|defined in| 2e8dda61_2812_b278_9fde_2756aae18380 4bf53477_4a4c_6605_deb4_78714e64ee47["test_basic_response()"] 4bf53477_4a4c_6605_deb4_78714e64ee47 -->|calls| 064593f6_700d_3df3_7fc7_30ff32de9e12 4bf53477_4a4c_6605_deb4_78714e64ee47["test_basic_response()"] 064593f6_700d_3df3_7fc7_30ff32de9e12 -->|calls| 4bf53477_4a4c_6605_deb4_78714e64ee47 9e841ba1_66c4_b71d_de35_9d0bbc02fb7d["get_response()"] 064593f6_700d_3df3_7fc7_30ff32de9e12 -->|calls| 9e841ba1_66c4_b71d_de35_9d0bbc02fb7d 2bdc2f20_dd9b_805b_2e64_60e7fcb8992f["assert_basic_response()"] 064593f6_700d_3df3_7fc7_30ff32de9e12 -->|calls| 2bdc2f20_dd9b_805b_2e64_60e7fcb8992f style 064593f6_700d_3df3_7fc7_30ff32de9e12 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/lib/streaming/test_beta_messages.py lines 190–207
def test_basic_response(self, respx_mock: MockRouter) -> None:
respx_mock.post("/v1/messages").mock(
return_value=httpx.Response(200, content=get_response("basic_response.txt"))
)
with sync_client.beta.messages.stream(
max_tokens=1024,
messages=[
{
"role": "user",
"content": "Say hello there!",
}
],
model="claude-3-opus-latest",
) as stream:
assert isinstance(cast(Any, stream), BetaMessageStream)
assert_basic_response([event for event in stream], stream.get_final_message())
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does test_basic_response() do?
test_basic_response() is a function in the anthropic-sdk-python codebase, defined in tests/lib/streaming/test_beta_messages.py.
Where is test_basic_response() defined?
test_basic_response() is defined in tests/lib/streaming/test_beta_messages.py at line 190.
What does test_basic_response() call?
test_basic_response() calls 3 function(s): assert_basic_response, get_response, test_basic_response.
What calls test_basic_response()?
test_basic_response() is called by 1 function(s): test_basic_response.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free