@@ -91,15 +91,15 @@ def test_langchain_open_ai_client(monkeypatch):
9191 # Mock the langchain_openai import
9292 mock_chat_openai = Mock ()
9393 mock_chat_openai .return_value = MagicMock (
94- openai_api_base = "https://test_host/serving-endpoints" ,
95- model_name = "databricks-meta-llama-3-1-70b-instruct"
94+ openai_api_base = "https://test_host/serving-endpoints" , model_name = "databricks-meta-llama-3-1-70b-instruct"
9695 )
9796
9897 # Mock the module import
9998 import sys
99+
100100 mock_module = MagicMock ()
101101 mock_module .ChatOpenAI = mock_chat_openai
102- sys .modules [' langchain_openai' ] = mock_module
102+ sys .modules [" langchain_openai" ] = mock_module
103103
104104 try :
105105 w = WorkspaceClient (config = Config ())
@@ -109,8 +109,8 @@ def test_langchain_open_ai_client(monkeypatch):
109109 assert client .model_name == "databricks-meta-llama-3-1-70b-instruct"
110110 finally :
111111 # Clean up the mock module
112- if ' langchain_openai' in sys .modules :
113- del sys .modules [' langchain_openai' ]
112+ if " langchain_openai" in sys .modules :
113+ del sys .modules [" langchain_openai" ]
114114
115115
116116def test_http_request (w , requests_mock ):
@@ -174,15 +174,15 @@ def test_get_langchain_chat_open_ai_client_deprecation_warning(monkeypatch):
174174 # Mock the langchain_openai import
175175 mock_chat_openai = Mock ()
176176 mock_chat_openai .return_value = MagicMock (
177- openai_api_base = "https://test_host/serving-endpoints" ,
178- model_name = "databricks-meta-llama-3-1-70b-instruct"
177+ openai_api_base = "https://test_host/serving-endpoints" , model_name = "databricks-meta-llama-3-1-70b-instruct"
179178 )
180179
181180 # Mock the module import
182181 import sys
182+
183183 mock_module = MagicMock ()
184184 mock_module .ChatOpenAI = mock_chat_openai
185- sys .modules [' langchain_openai' ] = mock_module
185+ sys .modules [" langchain_openai" ] = mock_module
186186
187187 try :
188188 w = WorkspaceClient (config = Config ())
@@ -203,5 +203,5 @@ def test_get_langchain_chat_open_ai_client_deprecation_warning(monkeypatch):
203203 assert client .model_name == "databricks-meta-llama-3-1-70b-instruct"
204204 finally :
205205 # Clean up the mock module
206- if ' langchain_openai' in sys .modules :
207- del sys .modules [' langchain_openai' ]
206+ if " langchain_openai" in sys .modules :
207+ del sys .modules [" langchain_openai" ]
0 commit comments