示例#1
0
    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])
示例#2
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)
示例#3
0
 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])
示例#4
0
 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)
示例#5
0
 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])
示例#6
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)
示例#7
0
 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])
示例#8
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)
示例#9
0
 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])