Beispiel #1
0
def test_hello_world_example():
    agent = run_hello_world(serve_forever=False)
    responses = agent.handle_message("hello bot")
    assert responses[-1] == "hey there!"

    responses.extend(agent.handle_message("goodbye"))
    assert responses[-1] == "default message"

    assert len(responses) == 2, ("The bot shouldn't have sent any other "
                                 "message then the above two")
Beispiel #2
0
def test_agent_handle_message():
    agent = run_hello_world(serve_forever=False)
    result = agent.handle_message("hello bot")
    assert result == ["hey there!"]