def test_handle_method(self): mic = testutils.TestMic() self.plugin.handle("What's the weather like tomorrow?", mic) self.assertEqual(len(mic.outputs), 1) self.assertTrue("can't see that far ahead" in mic.outputs[0] or "Tomorrow" in mic.outputs[0])
def test_handle_method(self): key = 'gmail_password' if key not in self.plugin.profile or not self.plugin.profile[key]: self.skipTest("Gmail password not available") mic = testutils.TestMic() self.plugin.handle("Check my email account!", mic)
def test_handle_method(self): mic = testutils.TestMic(inputs=["No."]) self.plugin.handle( {'input': "Find me some of the top hacker news stories."}, mic ) self.assertGreater(len(mic.outputs), 1) self.assertIn("current top stories", mic.outputs[1])
def test_handle_method(self): mic = testutils.TestMic(inputs=["Who's there?", "Random response"]) jokes = joke.get_jokes() self.plugin.handle( {'input': "Tell me a joke."}, mic ) self.assertEqual(len(mic.outputs), 3) self.assertIn((mic.outputs[1], mic.outputs[2]), jokes)
def test_handle_method(self): mic = testutils.TestMic() self.plugin.handle("What is the meaning of life?", mic) self.assertEqual(len(mic.outputs), 1) self.assertIn("42", mic.outputs[0])
def test_handle_method(self): if not profile.get(['email', 'password']): self.skipTest("Email password not available") mic = testutils.TestMic() self.plugin.handle({'input': "Check my email account!"}, mic)
def test_handle_method(self): mic = testutils.TestMic() self.plugin.handle("What time is it?", mic) self.assertEqual(len(mic.outputs), 1) self.assertIn("It is", mic.outputs[0])
def test_handle_method(self): mic = testutils.TestMic() self.plugin.handle({'input': "What is the meaning of life?"}, mic) self.assertEqual(len(mic.outputs), 1)
def test_handle_method(self): mic = testutils.TestMic(inputs=["No."]) self.plugin.handle("Find me some of the top news stories.", mic) self.assertGreater(len(mic.outputs), 1) self.assertIn("top headlines", mic.outputs[1])