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

test_follow_redirects() — anthropic-sdk-python Function Reference

Architecture documentation for the test_follow_redirects() 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
  34b60360_05fd_18ba_a466_78c97aafcbd2["test_follow_redirects()"]
  9bf4cfe0_e3b0_70de_25ac_2113c8918900["TestAsyncAnthropic"]
  34b60360_05fd_18ba_a466_78c97aafcbd2 -->|defined in| 9bf4cfe0_e3b0_70de_25ac_2113c8918900
  6f122e01_0050_5bd0_e528_1745511abcf3["test_follow_redirects()"]
  6f122e01_0050_5bd0_e528_1745511abcf3 -->|calls| 34b60360_05fd_18ba_a466_78c97aafcbd2
  6f122e01_0050_5bd0_e528_1745511abcf3["test_follow_redirects()"]
  34b60360_05fd_18ba_a466_78c97aafcbd2 -->|calls| 6f122e01_0050_5bd0_e528_1745511abcf3
  style 34b60360_05fd_18ba_a466_78c97aafcbd2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_client.py lines 2071–2080

    async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncAnthropic) -> None:
        # Test that the default follow_redirects=True allows following redirects
        respx_mock.post("/redirect").mock(
            return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
        )
        respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))

        response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
        assert response.status_code == 200
        assert response.json() == {"status": "ok"}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free