MCPcopy
hub / github.com/openai/openai-python / test_base_url_setter

Method test_base_url_setter

tests/test_client.py:888–901  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"):

Callers

nothing calls this directly

Calls 2

OpenAIClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected