from programytest.client import TestClient from programy.bot import Bot my_bot = Bot() my_client = TestClient(my_bot) response = my_client.ask_question("Hello") print(response)
from programytest.client import TestClient from programy.bot import Bot my_bot = Bot() my_client = TestClient(my_bot) inputs = ["Is it going to rain today?", "What is the weather like in Sydney?", "Is it hot outside?"] for input in inputs: response = my_client.ask_question(input) print(response)
from programytest.client import TestClient from programy.bot import Bot my_bot = Bot() my_client = TestClient(my_bot) inputs = ["What is the meaning of life?", "Where is the nearest galaxy?", "Tell me a joke."] for input in inputs: response = my_client.ask_question(input) print(response)In summary, the TestClient class that belongs to the programytest.client package library in Python is useful to test the chatbot and to make sure that it is responsive, understands user input, and answers questions correctly.