@@ -26,7 +26,7 @@ def chat_plugin(mock_config):
2626
2727class TestChatWithDataPlugin :
2828 @patch ("plugins.chat_with_data_plugin.get_bearer_token_provider" )
29- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
29+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
3030 @pytest .mark .asyncio
3131 async def test_greeting (self , mock_azure_openai , mock_token_provider , chat_plugin ):
3232 # Setup mock token provider
@@ -92,7 +92,7 @@ async def test_greeting_with_ai_project_client(self, mock_azure_credential, mock
9292 assert args ["messages" ][1 ]["content" ] == "Hello"
9393
9494 @pytest .mark .asyncio
95- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
95+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
9696 async def test_greeting_exception (self , mock_azure_openai , chat_plugin ):
9797 # Setup mock to raise exception
9898 mock_client = MagicMock ()
@@ -108,7 +108,7 @@ async def test_greeting_exception(self, mock_azure_openai, chat_plugin):
108108 @pytest .mark .asyncio
109109 @patch ("plugins.chat_with_data_plugin.get_bearer_token_provider" )
110110 @patch ("plugins.chat_with_data_plugin.execute_sql_query" )
111- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
111+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
112112 async def test_get_SQL_Response (self , mock_azure_openai , mock_execute_sql , mock_token_provider , chat_plugin ):
113113
114114 # Setup mocks
@@ -166,7 +166,7 @@ async def test_get_SQL_Response_with_ai_project_client(self, mock_azure_credenti
166166
167167 @pytest .mark .asyncio
168168 @patch ("plugins.chat_with_data_plugin.execute_sql_query" )
169- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
169+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
170170 async def test_get_SQL_Response_exception (self , mock_azure_openai , mock_execute_sql , chat_plugin ):
171171 # Setup mock to raise exception
172172 mock_client = MagicMock ()
@@ -182,7 +182,7 @@ async def test_get_SQL_Response_exception(self, mock_azure_openai, mock_execute_
182182
183183 @pytest .mark .asyncio
184184 @patch ("plugins.chat_with_data_plugin.get_bearer_token_provider" )
185- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
185+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
186186 async def test_get_answers_from_calltranscripts (self , mock_azure_openai , mock_token_provider , chat_plugin ):
187187 # Setup mock
188188 mock_token_provider .return_value = lambda : "fake_token"
@@ -216,7 +216,7 @@ async def test_get_answers_from_calltranscripts(self, mock_azure_openai, mock_to
216216 assert args ["extra_body" ]["data_sources" ][0 ]["type" ] == "azure_search"
217217
218218 @pytest .mark .asyncio
219- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
219+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
220220 async def test_get_answers_from_calltranscripts_with_citations (self , mock_azure_openai , chat_plugin ):
221221 # Setup mock with citations in context
222222 mock_client = MagicMock ()
@@ -251,7 +251,7 @@ async def test_get_answers_from_calltranscripts_with_citations(self, mock_azure_
251251 assert result .message .context .citations [0 ]["content" ].endswith ("..." )
252252
253253 @pytest .mark .asyncio
254- @patch ("plugins.chat_with_data_plugin .openai.AzureOpenAI" )
254+ @patch ("helpers.azure_openai_helper .openai.AzureOpenAI" )
255255 async def test_get_answers_from_calltranscripts_exception (self , mock_azure_openai , chat_plugin ):
256256 # Setup mock to raise exception
257257 mock_client = MagicMock ()
0 commit comments