assert_message_matches() — anthropic-sdk-python Function Reference
Architecture documentation for the assert_message_matches() function in test_beta_messages.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD b6dcecb2_d1cc_b379_c8e2_2beae6f86849["assert_message_matches()"] 239f7d64_6d26_d418_04e3_d586fe367986["test_beta_messages.py"] b6dcecb2_d1cc_b379_c8e2_2beae6f86849 -->|defined in| 239f7d64_6d26_d418_04e3_d586fe367986 91cf480e_9510_5f3d_ae64_10ee575eb62f["assert_basic_response()"] 91cf480e_9510_5f3d_ae64_10ee575eb62f -->|calls| b6dcecb2_d1cc_b379_c8e2_2beae6f86849 59d20233_d69f_b950_5ea4_1ee77ec38630["assert_tool_use_response()"] 59d20233_d69f_b950_5ea4_1ee77ec38630 -->|calls| b6dcecb2_d1cc_b379_c8e2_2beae6f86849 a2ff7c83_4d2b_9970_c545_c709b7a67707["assert_incomplete_partial_input_response()"] a2ff7c83_4d2b_9970_c545_c709b7a67707 -->|calls| b6dcecb2_d1cc_b379_c8e2_2beae6f86849 style b6dcecb2_d1cc_b379_c8e2_2beae6f86849 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/lib/streaming/test_beta_messages.py lines 163–170
def assert_message_matches(message: BetaMessage, expected: Dict[str, Any]) -> None:
actual_message_json = message.model_dump_json(
indent=2, exclude_none=True, exclude={"content": {"__all__": {"__json_buf"}}}
)
test_case = TestCase()
test_case.maxDiff = None
test_case.assertEqual(expected, json.loads(actual_message_json))
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does assert_message_matches() do?
assert_message_matches() is a function in the anthropic-sdk-python codebase, defined in tests/lib/streaming/test_beta_messages.py.
Where is assert_message_matches() defined?
assert_message_matches() is defined in tests/lib/streaming/test_beta_messages.py at line 163.
What calls assert_message_matches()?
assert_message_matches() is called by 3 function(s): assert_basic_response, assert_incomplete_partial_input_response, assert_tool_use_response.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free