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

test_follow_redirects_disabled() — anthropic-sdk-python Function Reference

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

Function python AnthropicClient SyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  dfccdbcd_c5e3_9fd2_966b_c1e56152d6f3["test_follow_redirects_disabled()"]
  d53b6c34_1743_a045_4be1_3554ab153964["TestAnthropic"]
  dfccdbcd_c5e3_9fd2_966b_c1e56152d6f3 -->|defined in| d53b6c34_1743_a045_4be1_3554ab153964
  4f94bb4d_85d6_4daa_3367_31e017ea8e70["test_follow_redirects_disabled()"]
  4f94bb4d_85d6_4daa_3367_31e017ea8e70 -->|calls| dfccdbcd_c5e3_9fd2_966b_c1e56152d6f3
  4f94bb4d_85d6_4daa_3367_31e017ea8e70["test_follow_redirects_disabled()"]
  dfccdbcd_c5e3_9fd2_966b_c1e56152d6f3 -->|calls| 4f94bb4d_85d6_4daa_3367_31e017ea8e70
  style dfccdbcd_c5e3_9fd2_966b_c1e56152d6f3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 1080–1090

    def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Anthropic) -> None:
        # Test that follow_redirects=False prevents following redirects
        respx_mock.post("/redirect").mock(
            return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
        )

        with pytest.raises(APIStatusError) as exc_info:
            client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response)

        assert exc_info.value.response.status_code == 302
        assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free