Пример #1
0
 def test_blank_tweet(self):
     tweet = Tweet('')
     self.assertEqual(tweet.get_links(), [])
     self.assertEqual(tweet.get_mentions(), [])
     self.assertEqual(tweet.get_topics(), [])
Пример #2
0
 def test_get_multi_links(self):
     tweet = Tweet(
         'Hey there @charles check these out, http://t.co/thisistest http://t.co/test22test'
     )
     self.assertEqual(tweet.get_links(),
                      ['http://t.co/thisistest', 'http://t.co/test22test'])
Пример #3
0
 def test_too_long_url(self):
     tweet = Tweet('http://t.co/testingthisreallylongurl')
     self.assertEqual(tweet.get_links(), [])
Пример #4
0
 def test_get_links(self):
     tweet = Tweet('dont click random link http://t.co/thisistest')
     self.assertEqual(tweet.get_links(), ['http://t.co/thisistest'])
Пример #5
0
 def test_blank_tweet(self):
     tweet = Tweet("")
     self.assertEqual(tweet.get_links(), [])
     self.assertEqual(tweet.get_mentions(), [])
     self.assertEqual(tweet.get_topics(), [])
Пример #6
0
 def test_too_long_url(self):
     tweet = Tweet("http://t.co/testingthisreallylongurl")
     self.assertEqual(tweet.get_links(), [])
Пример #7
0
 def test_get_multi_links(self):
     tweet = Tweet("Hey there @charles check these out, http://t.co/thisistest http://t.co/test22test")
     self.assertEqual(tweet.get_links(), ["http://t.co/thisistest", "http://t.co/test22test"])
Пример #8
0
 def test_get_links(self):
     tweet = Tweet("dont click random link http://t.co/thisistest")
     self.assertEqual(tweet.get_links(), ["http://t.co/thisistest"])