示例#1
0
 def test_split_message_two_messages(self):
     test_message =  ("This is a test string with more than 140 characters"
         ". Adding useless words to make the string longer. This was not"
         " enough we need even more words. Adding a few more words to make"
         " it more distinct.")
     test_message1 = test_message[:133] + " (1/2)"
     test_message2 = test_message[134:] + " (2/2)"
     self.assertEqual([test_message1, test_message2], 
         TwitterBot.split_message(self, test_message))
示例#2
0
 def test_split_message_two_messages(self):
     test_message = (
         "This is a test string with more than 140 characters"
         ". Adding useless words to make the string longer. This was not"
         " enough we need even more words. Adding a few more words to make"
         " it more distinct.")
     test_message1 = test_message[:133] + " (1/2)"
     test_message2 = test_message[134:] + " (2/2)"
     self.assertEqual([test_message1, test_message2],
                      TwitterBot.split_message(self, test_message))
示例#3
0
 def test_split_message_three_messages(self):
     test_message =  ("This is a test string with more than 280 characters"
             ". Adding useless words to make the string longer. This was "
             "not enough we need even more words. Mary had a little lamb. "
             "His fleece was white as snow. And everywhere that Mary went, "
             "the lamb was sure to go. He followed her to school one day. "
             "Which was against the rule. It made the children laugh and "
             "play, to see a lamb at school.")
     test_message1 = test_message[:133] + " (1/3)"
     test_message2 = test_message[134:267] + " (2/3)"
     test_message3 = test_message[268:] + " (3/3)"
     self.assertEqual([test_message1, test_message2, test_message3], 
         TwitterBot.split_message(self, test_message))
示例#4
0
 def test_split_message_three_messages(self):
     test_message = (
         "This is a test string with more than 280 characters"
         ". Adding useless words to make the string longer. This was "
         "not enough we need even more words. Mary had a little lamb. "
         "His fleece was white as snow. And everywhere that Mary went, "
         "the lamb was sure to go. He followed her to school one day. "
         "Which was against the rule. It made the children laugh and "
         "play, to see a lamb at school.")
     test_message1 = test_message[:133] + " (1/3)"
     test_message2 = test_message[134:267] + " (2/3)"
     test_message3 = test_message[268:] + " (3/3)"
     self.assertEqual([test_message1, test_message2, test_message3],
                      TwitterBot.split_message(self, test_message))
示例#5
0
 def test_split_message_one_message(self):
     test_message = "This is a test string with less than 140 characters."
     self.assertEqual([test_message], TwitterBot.split_message(self, test_message))
示例#6
0
 def test_split_message_one_message(self):
     test_message = "This is a test string with less than 140 characters."
     self.assertEqual([test_message],
                      TwitterBot.split_message(self, test_message))