@@ -11,10 +11,10 @@ def test_open_ai_client(monkeypatch):
1111 monkeypatch .setenv ('DATABRICKS_HOST' , 'test_host' )
1212 monkeypatch .setenv ('DATABRICKS_TOKEN' , 'test_token' )
1313 w = WorkspaceClient (config = Config ())
14- w .serving_endpoints .get_open_ai_client ()
14+ client = w .serving_endpoints .get_open_ai_client ()
1515
16- # assert client.base_url == "https://test_host/serving-endpoints/"
17- # assert client.api_key == "test_token "
16+ assert client .base_url == "https://test_host/serving-endpoints/"
17+ assert client .api_key == "no-token "
1818
1919
2020@pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "Requires Python > 3.7" )
@@ -24,7 +24,7 @@ def test_langchain_open_ai_client(monkeypatch):
2424 monkeypatch .setenv ('DATABRICKS_HOST' , 'test_host' )
2525 monkeypatch .setenv ('DATABRICKS_TOKEN' , 'test_token' )
2626 w = WorkspaceClient (config = Config ())
27- w .serving_endpoints .get_langchain_chat_open_ai_client ("databricks-meta-llama-3-1-70b-instruct" )
27+ client = w .serving_endpoints .get_langchain_chat_open_ai_client ("databricks-meta-llama-3-1-70b-instruct" )
2828
29- # assert client.openai_api_base == "https://test_host/serving-endpoints"
30- # assert client.model_name == "databricks-meta-llama-3-1-70b-instruct"
29+ assert client .openai_api_base == "https://test_host/serving-endpoints"
30+ assert client .model_name == "databricks-meta-llama-3-1-70b-instruct"
0 commit comments