示例#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