Skip to content

Commit

Permalink
Fixed test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh committed Dec 13, 2023
1 parent 97d0d06 commit 16aaf12
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/integration_test/chat_service_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,17 @@ def test_business_messages_without_message(mock_process_message, mock_check_mess


@patch("kairon.chat.handlers.channels.business_messages.BusinessMessagesHandler.check_message_create_time")
@patch("kairon.chat.agent_processor.AgentProcessor.reload")
@patch("kairon.chat.agent_processor.AgentProcessor.cache_provider.get")
@patch('oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_dict')
@patch('businessmessages.businessmessages_v1_client.BusinessmessagesV1')
def test_business_messages_with_valid_data(mock_business_messages, mock_credentials,
def test_business_messages_with_valid_data(mock_business_messages, mock_credentials, mock_get_agent, mock_reload,
mock_check_message_create_time):
mock_check_message_create_time.return_value = True
mock_get_agent.return_value = KaironAgent
mock_credentials.return_value = {}
mock_business_messages.return_value = {}
with patch.object(Agent, "handle_message") as mock_agent:
with patch.object(KaironAgent, "handle_message") as mock_agent:
mock_agent.side_effect = mock_agent_response
response = client.post(
f"/api/bot/business_messages/{bot}/{token}",
Expand Down

0 comments on commit 16aaf12

Please sign in to comment.