示例#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))
示例#2
0
 def test_matches_name(self):
     message = Message(None, None, "fred say hello")
     self.assertTrue(self.matcher.match(message))
示例#3
0
 def test_matches_name_with_extra_chars(self):
     message = Message(None, None, "@fred: say hello")
     self.assertTrue(self.matcher.match(message))
示例#4
0
 def test_does_not_match_name(self):
     message = Message(None, None, "hubot say hello")
     self.assertIsNone(self.matcher.match(message))
示例#5
0
 def test_empty_message_text(self):
     message = Message(None, None, "")
     self.assertIsNone(self.matcher.match(message))
示例#6
0
 def test_message_with_no_text(self):
     message = Message(None, None, None)
     self.assertIsNone(self.matcher.match(message))
示例#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))
示例#8
0
 def test_regex_does_not_match(self):
     message = Message(None, None, "the fox")
     self.assertIsNone(self.matcher.match(message))