Exemplo n.º 1
0
 def test_smiley(self):
     self.assertEqual(
         m.split_recipient_and_message("user: :multihail:"),
         ("user", " :multihail:")
     )
Exemplo n.º 2
0
 def test_simple(self):
     self.assertEqual(
         m.split_recipient_and_message("root: sup"),
         ("root", " sup")
     )
Exemplo n.º 3
0
 def test_no_colon(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("one two three five")
Exemplo n.º 4
0
 def test_all_colons_escaped(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("one\\: two\\: three\\\\\\: four\\:")
Exemplo n.º 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?")
     )
Exemplo n.º 6
0
 def test_invalid_escape(self):
     with self.assertRaises(ValueError):
         m.split_recipient_and_message("test\\a: lol")
Exemplo n.º 7
0
 def test_escaped_colon(self):
     self.assertEqual(
         m.split_recipient_and_message("colon\\:cancer: Weird nickname."),
         ("colon:cancer", " Weird nickname.")
     )
Exemplo n.º 8
0
 def test_second_colon(self):
     self.assertEqual(
         m.split_recipient_and_message("fps doug: jeremy: uber micro"),
         ("fps doug", " jeremy: uber micro")
     )
Exemplo n.º 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?")
     )
Exemplo n.º 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?")
     )
Exemplo n.º 11
0
 def test_spaces_in_nick(self):
     self.assertEqual(
         m.split_recipient_and_message("The Irony: hi"),
         ("The Irony", " hi")
     )