| 886 | assert response.foo == 2 |
| 887 | |
| 888 | def test_base_url_setter(self) -> None: |
| 889 | client = OpenAI( |
| 890 | base_url="https://example.com/from_init", |
| 891 | api_key=api_key, |
| 892 | admin_api_key=admin_api_key, |
| 893 | _strict_response_validation=True, |
| 894 | ) |
| 895 | assert client.base_url == "https://example.com/from_init/" |
| 896 | |
| 897 | client.base_url = "https://example.com/from_setter" # type: ignore[assignment] |
| 898 | |
| 899 | assert client.base_url == "https://example.com/from_setter/" |
| 900 | |
| 901 | client.close() |
| 902 | |
| 903 | def test_base_url_env(self) -> None: |
| 904 | with update_env(OPENAI_BASE_URL="http://localhost:5000/from/env"): |