MCPcopy Create free account
hub / github.com/grapeot/devin.cursorrules / test_query_gemini

Method test_query_gemini

tests/test_llm_api.py:294–303  ·  view source on GitHub ↗
(self, mock_create_client)

Source from the content-addressed store, hash-verified

292 @unittest.skipIf(skip_llm_tests, skip_message)
293 @patch('tools.llm_api.create_llm_client')
294 def test_query_gemini(self, mock_create_client):
295 mock_create_client.return_value = self.mock_gemini_client # Use the updated mock from setUp
296 response = query_llm("Test prompt", provider="gemini")
297 self.assertEqual(response, "Test Gemini response")
298 # Update assertions to check chat flow
299 self.mock_gemini_client.GenerativeModel.assert_called_once_with("gemini-2.0-flash-exp")
300 self.mock_gemini_model.start_chat.assert_called_once_with(
301 history=[{'role': 'user', 'parts': ["Test prompt"]}]
302 )
303 self.mock_gemini_chat_session.send_message.assert_called_once_with("Test prompt")
304
305 @unittest.skipIf(skip_llm_tests, skip_message)
306 @patch('tools.llm_api.create_llm_client')

Callers

nothing calls this directly

Calls 1

query_llmFunction · 0.90

Tested by

no test coverage detected