コード例 #1
0
 def test_sentiment_empty(self):
     processor = Processor()
     self.assertEqual(round(processor.textSentiment("")), 0)
コード例 #2
0
 def test_sentiment_negative(self):
     processor = Processor()
     self.assertLessEqual(
         processor.textSentiment("This project was the worst."), -0.5)
コード例 #3
0
 def test_sentiment_neutral(self):
     processor = Processor()
     self.assertEqual(
         round(processor.textSentiment("This event was okay.")), 0)
コード例 #4
0
 def test_sentiment_positive(self):
     processor = Processor()
     self.assertGreaterEqual(
         processor.textSentiment("This workshop was incredible."), 0.5)