예제 #1
0
async def conversation_time(current_user: User = Depends(
    auth.get_current_user)):
    return {"data": ChatHistory.conversation_time(current_user.get_bot())}
예제 #2
0
async def conversation_time(current_user: User = Depends(
    auth.get_current_user)):
    """ This returns the duration of the chat that took place between the user and the
        chatbot """
    return {"data": ChatHistory.conversation_time(current_user.get_bot())}
예제 #3
0
 def test_conversation_time_empty(self, mock_chat_history_empty):
     conversation_time = ChatHistory.conversation_time("tests")
     assert not conversation_time
예제 #4
0
 def test_conversation_time(self, mock_chat_history):
     conversation_time = ChatHistory.conversation_time("tests")
     assert conversation_time
예제 #5
0
 def test_conversation_time_error(self, mock_get_tracker_and_domain):
     with pytest.raises(Exception):
         conversation_time = ChatHistory.conversation_time("tests")
         assert not conversation_time