async def chat_history_users(current_user: User = Depends( auth.get_current_user)): return { "data": { "users": ChatHistory.fetch_chat_users(current_user.get_bot()) } }
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()) } }
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
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
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