def test_time(self): from chatterbot.logic import TimeLogicAdapter adapter = TimeLogicAdapter(self.chatbot) statement = Statement(text='What time is it?') response = adapter.process(statement) self.assertIn('The current time is', response.text) self.assertEqual(response.confidence, 1)
def test_time(self): from chatterbot.logic import TimeLogicAdapter adapter = TimeLogicAdapter(self.chatbot) statement = Statement(text='What time is it?') response = adapter.process(statement) self.assertIn('The current time is', response.text) self.assertEqual(response.confidence, 1)
class TimeAdapterTests(TestCase): def setUp(self): self.adapter = TimeLogicAdapter() def test_positive_input(self): statement = Statement("Do you know what time it is?") response = self.adapter.process(statement) self.assertEqual(response.confidence, 1) self.assertIn("The current time is ", response.text) def test_negative_input(self): statement = Statement("What is an example of a pachyderm?") response = self.adapter.process(statement) self.assertEqual(response.confidence, 0) self.assertIn("The current time is ", response.text)
class TimeAdapterTests(TestCase): def setUp(self): self.adapter = TimeLogicAdapter() def test_positive_input(self): statement = Statement("Do you know what time it is?") response = self.adapter.process(statement) self.assertEqual(response.confidence, 1) self.assertIn("The current time is ", response.text) def test_negative_input(self): statement = Statement("What is an example of a pachyderm?") response = self.adapter.process(statement) self.assertEqual(response.confidence, 0) self.assertIn("The current time is ", response.text)
def setUp(self): super().setUp() self.adapter = TimeLogicAdapter(self.chatbot)
def setUp(self): self.adapter = TimeLogicAdapter()
def setUp(self): self.adapter = TimeLogicAdapter()