-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_emotion_detection.py
More file actions
22 lines (16 loc) · 930 Bytes
/
test_emotion_detection.py
File metadata and controls
22 lines (16 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest
from EmotionDetection.emotion_detection import emotion_detector
class TestSentimentAnalyzer(unittest.TestCase):
def test_emotion_analyzer(self):
result_1 = emotion_detector('I am glad this happened')
self.assertEqual(result_1['dominant_emotion'], 'Joy')
result_2 = emotion_detector('I am really mad about this')
self.assertEqual(result_2['dominant_emotion'], 'Anger')
result_3 = emotion_detector('I feel disgusted just hearing about this')
self.assertEqual(result_3['dominant_emotion'], 'Disgust')
result_4 = emotion_detector('I am so sad about this')
self.assertEqual(result_4['dominant_emotion'], 'Sadness')
result_5 = emotion_detector('I am really afraid that this will happen')
self.assertEqual(result_5['dominant_emotion'], 'Fear')
if __name__ == '__main__':
unittest.main()