Skip to content

Commit

Permalink
Update test_gemini_endpoint.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KKGanguly authored Nov 27, 2024
1 parent 176a2b0 commit acbc8bb
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions tests/test_gemini_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ def test_get_gemini_response(self, mock_query_gemini_model):

# Check that query_gemini_model was called once with the correct argument
mock_query_gemini_model.assert_called_once_with(user_message)

@patch('app.routes.query_gemini_model') # Mock query_gemini_model function
def test_get_gemini_response_no_message(self, mock_query_gemini_model):

# Simulate a POST request with no message in the JSON data
response = self.app.post('/get_gemini_response',
data=json.dumps({}),
content_type='application/json')

# Assertions
self.assertEqual(response.status_code, 500) # Bad request, since message is missing


@patch('app.routes.query_gemini_model') # Mock query_gemini_model function
def test_get_gemini_response_invalid_json(self, mock_query_gemini_model):
Expand Down

0 comments on commit acbc8bb

Please sign in to comment.