Exemple #1
0
 def test_smiley(self):
     self.assertEqual(
         m.split_recipient_and_message("user: :multihail:"),
         ("user", " :multihail:")
     )
Exemple #2
0
 def test_simple(self):
     self.assertEqual(
         m.split_recipient_and_message("root: sup"),
         ("root", " sup")
     )
Exemple #3
0
 def test_no_colon(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("one two three five")
Exemple #4
0
 def test_all_colons_escaped(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("one\\: two\\: three\\\\\\: four\\:")
Exemple #5
0
 def test_escaped_backslash(self):
     self.assertEqual(
         m.split_recipient_and_message("backslash\\\\: r u a l33t h4x0r?"),
         ("backslash\\", " r u a l33t h4x0r?")
     )
Exemple #6
0
 def test_invalid_escape(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("test\\a: lol")
Exemple #7
0
 def test_escaped_colon(self):
     self.assertEqual(
         m.split_recipient_and_message("colon\\:cancer: Weird nickname."),
         ("colon:cancer", " Weird nickname.")
     )
Exemple #8
0
 def test_second_colon(self):
     self.assertEqual(
         m.split_recipient_and_message("fps doug: jeremy: uber micro"),
         ("fps doug", " jeremy: uber micro")
     )
Exemple #9
0
 def test_spaces_in_nick_and_message(self):
     self.assertEqual(
         m.split_recipient_and_message("Alexander the Great: What's the story, morning glory?"),
         ("Alexander the Great", " What's the story, morning glory?")
     )
Exemple #10
0
 def test_spaces_in_message(self):
     self.assertEqual(
         m.split_recipient_and_message("chef: What's the story, morning glory?"),
         ("chef", " What's the story, morning glory?")
     )
Exemple #11
0
 def test_spaces_in_nick(self):
     self.assertEqual(
         m.split_recipient_and_message("The Irony: hi"),
         ("The Irony", " hi")
     )