Skip to content

Commit 37906ee

Browse files
fix unittestcase test_get_answers_from_calltranscripts
1 parent 56b2b54 commit 37906ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/tests/api/plugins/test_chat_with_data_plugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,18 @@ async def test_get_SQL_Response_exception(self, mock_azure_openai, mock_execute_
181181
mock_execute_sql.assert_not_called()
182182

183183
@pytest.mark.asyncio
184-
@patch("plugins.chat_with_data_plugin.get_bearer_token_provider")
184+
@patch("helpers.azure_openai_helper.Config")
185+
@patch("helpers.azure_openai_helper.get_bearer_token_provider")
185186
@patch("helpers.azure_openai_helper.openai.AzureOpenAI")
186-
async def test_get_answers_from_calltranscripts(self, mock_azure_openai, mock_token_provider, chat_plugin):
187+
async def test_get_answers_from_calltranscripts(self, mock_azure_openai, mock_token_provider, mock_config, chat_plugin):
187188
# Setup mock
188189
mock_token_provider.return_value = lambda: "fake_token"
189190
mock_client = MagicMock()
190191
mock_azure_openai.return_value = mock_client
192+
mock_config_instance = MagicMock()
193+
mock_config_instance.azure_openai_endpoint = "https://test-openai.azure.com/"
194+
mock_config_instance.azure_openai_api_version = "2024-02-15-preview"
195+
mock_config.return_value = mock_config_instance
191196
mock_completion = MagicMock()
192197
mock_completion.choices = [MagicMock()]
193198
mock_completion.choices[0].message = MagicMock()

0 commit comments

Comments
 (0)