| 808 | assert response.foo == 2 |
| 809 | |
| 810 | def test_base_url_setter(self) -> None: |
| 811 | client = Anthropic(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) |
| 812 | assert client.base_url == "https://example.com/from_init/" |
| 813 | |
| 814 | client.base_url = "https://example.com/from_setter" # type: ignore[assignment] |
| 815 | |
| 816 | assert client.base_url == "https://example.com/from_setter/" |
| 817 | |
| 818 | client.close() |
| 819 | |
| 820 | def test_base_url_env(self) -> None: |
| 821 | with update_env(ANTHROPIC_BASE_URL="http://localhost:5000/from/env"): |