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

test_binary_content_upload_with_body_is_deprecated() — anthropic-sdk-python Function Reference

Architecture documentation for the test_binary_content_upload_with_body_is_deprecated() 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
  b0682c63_f6f6_03f9_7fa5_443651614e2b["test_binary_content_upload_with_body_is_deprecated()"]
  9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"]
  b0682c63_f6f6_03f9_7fa5_443651614e2b -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900
  3ea53f7d_0768_d9e9_2f8c_7ad925d93bde["test_binary_content_upload_with_body_is_deprecated()"]
  3ea53f7d_0768_d9e9_2f8c_7ad925d93bde -->|calls| b0682c63_f6f6_03f9_7fa5_443651614e2b
  3ea53f7d_0768_d9e9_2f8c_7ad925d93bde["test_binary_content_upload_with_body_is_deprecated()"]
  b0682c63_f6f6_03f9_7fa5_443651614e2b -->|calls| 3ea53f7d_0768_d9e9_2f8c_7ad925d93bde
  style b0682c63_f6f6_03f9_7fa5_443651614e2b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 1591–1610

    async def test_binary_content_upload_with_body_is_deprecated(
        self, respx_mock: MockRouter, async_client: AsyncAnthropic
    ) -> None:
        respx_mock.post("/upload").mock(side_effect=mirror_request_content)

        file_content = b"Hello, this is a test file."

        with pytest.deprecated_call(
            match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead."
        ):
            response = await async_client.post(
                "/upload",
                body=file_content,
                cast_to=httpx.Response,
                options={"headers": {"Content-Type": "application/octet-stream"}},
            )

        assert response.status_code == 200
        assert response.request.headers["Content-Type"] == "application/octet-stream"
        assert response.content == file_content

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free