Ejemplo n.º 1
0
 def test_validEncoding(self):
     api = createApiStreaming()
     statusIterator = api.getStream(selectRandomTopic())
     for status in statusIterator:
         print(status["text"])
         tweet = status2Tweet(status)
         print(tweet.text)
         break
 def test_addRepeatedTweet(self):
     global status
     lb = LocalBuffer()
     tweet = status2Tweet( status )
     lb.addTweet(tweet)
     self.assertRaises(Exception, lb.addTweet, tweet)
 def test_addTweet(self):
     global status
     lb = LocalBuffer()
     tweet = status2Tweet( status )
     lb.addTweet(tweet)
     self.assertEqual(len(lb.tweetList.getList()), 1)
 def test_status2Tweet(self):
     global status
     tweet = status2Tweet( status )