Esempio n. 1
0
class SimpleSentimentAnalyzerTest(unittest.TestCase):

    def setUp(self):
        self.dc = SimpleSentimentAnalyzer()
        self.pos_tweet = 'Congrats SolarCitys discount approach to going public pays off'
        self.neg_tweet = 'Done with wack ass finals!!!'
        
    def test_get_tweet_text_mood(self):
        result_pos = self.dc.get_tweet_text_mood(self.pos_tweet)
        self.assertEqual(2,result_pos)
        
        result_neg = self.dc.get_tweet_text_mood(self.neg_tweet)
        self.assertEqual(-4,result_neg)