Ejemplo n.º 1
0
 def test_matches_name_after_being_changed(self):
     self.robot.name = 'Ted'
     message = Message(None, None, "ted say hello")
     self.assertTrue(self.matcher.match(message))
Ejemplo n.º 2
0
 def test_matches_name(self):
     message = Message(None, None, "fred say hello")
     self.assertTrue(self.matcher.match(message))
Ejemplo n.º 3
0
 def test_matches_name_with_extra_chars(self):
     message = Message(None, None, "@fred: say hello")
     self.assertTrue(self.matcher.match(message))
Ejemplo n.º 4
0
 def test_does_not_match_name(self):
     message = Message(None, None, "hubot say hello")
     self.assertIsNone(self.matcher.match(message))
Ejemplo n.º 5
0
 def test_empty_message_text(self):
     message = Message(None, None, "")
     self.assertIsNone(self.matcher.match(message))
Ejemplo n.º 6
0
 def test_message_with_no_text(self):
     message = Message(None, None, None)
     self.assertIsNone(self.matcher.match(message))
Ejemplo n.º 7
0
 def test_regex_matches(self):
     message = Message(None, None, "the quick fox")
     match = self.matcher.match(message)
     self.assertEquals("quick", match.group(1))
Ejemplo n.º 8
0
 def test_regex_does_not_match(self):
     message = Message(None, None, "the fox")
     self.assertIsNone(self.matcher.match(message))