Beispiel #1
0
async def chat_history_users(current_user: User = Depends(
    auth.get_current_user)):
    return {
        "data": {
            "users": ChatHistory.fetch_chat_users(current_user.get_bot())
        }
    }
Beispiel #2
0
async def chat_history_users(current_user: User = Depends(
    auth.get_current_user)):
    """ This function returns the list of the chatbot users """
    return {
        "data": {
            "users": ChatHistory.fetch_chat_users(current_user.get_bot())
        }
    }
Beispiel #3
0
 def test_fetch_chat_users_db_error(self, mock_mongo_processor):
     with pytest.raises(Exception):
         users = ChatHistory.fetch_chat_users(bot="tests")
         assert len(users) == 0
Beispiel #4
0
 def test_fetch_chat_users_error(self, mock_get_tracker_and_domain):
     with pytest.raises(Exception):
         users = ChatHistory.fetch_chat_users(bot="tests")
         assert len(users) == 0
Beispiel #5
0
 def test_fetch_chat_users_empty(self, mock_chat_history_empy):
     with pytest.raises(Exception):
         users = ChatHistory.fetch_chat_users(bot="tests")
         assert len(users) == 0