Exemplo n.º 1
0
 def parseTwitterStatus(self):
     """A real-world Twitter status feed can be parsed."""
     name = self.example_account
     owner = self.example_account
     url = "http://twitter.com/" + self.example_account
     t = TwitterStatus(name, owner, url)
     t.parse()
Exemplo n.º 2
0
 def testIgnoreRetweet(self):
     """Twitter retweets, which are annoying, can be ignored."""
     self.assertTrue(TwitterStatus.is_retweet(self.tweet_with_retweet))
Exemplo n.º 3
0
 def testIgnoreReply(self):
     """Twitter replies can be ignored."""
     self.assertTrue(TwitterStatus.is_reply(self.tweet_with_reply))
Exemplo n.º 4
0
 def testLinkUsernameWithPunctuation(self):
     """A Twitter username with trailing punctuation can be linked."""
     expected = """@<a href="http://twitter.com/NuerOb/">NuerOb</a>: I am like a pot roast, but better!"""
     result = TwitterStatus.link_users(self.tweet_with_username)
     assert result == expected
Exemplo n.º 5
0
 def testLinkUsername(self):
     """Twitter usernames are automatically linked."""
     expected = """@<a href="http://twitter.com/mozzarella/">mozzarella</a> Are you buffalo or garden variety?"""
     result = TwitterStatus.link_users(self.tweet_with_username)
     assert result == expected
Exemplo n.º 6
0
 def testLinkHashtag(self):
     """Twitter hashtags are automatically linked."""
     expected = """This caprese has changed my life! <a href="http://twitter.com/search?q=%23inspirationalsalads">#inspirationalsalads</a>"""
     result = TwitterStatus.link_hashtags(self.tweet_with_hashtag)
     assert result == expected