Skip to content

Commit 18612bb

Browse files
committed
Update tests
1 parent 0bd52c0 commit 18612bb

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

databricks/sdk/mixins/open_ai_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def __init__(self, get_headers_func):
1515
self.get_headers_func = get_headers_func
1616

1717
def auth_flow(self, request: httpx.Request) -> httpx.Request:
18-
print("Calling Authenticate")
1918
auth_headers = self.get_headers_func()
2019
request.headers["Authorization"] = auth_headers["Authorization"]
2120
yield request

tests/test_open_ai_mixin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)