-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_emotion_detection.py
22 lines (16 loc) · 1 KB
/
test_emotion_detection.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from EmotionDetection.emotion_detection import emotion_detector
from EmotionDetection.emotion_detection import emotion_predictor
import unittest
class TestEmotionDetection(unittest.TestCase):
def test_emotion_predictor(self):
result_1 = emotion_predictor(emotion_detector("I am glad this happened"))
self.assertEqual(result_1['dominant_emotion'], 'joy')
result_2 = emotion_predictor(emotion_detector("I am really mad about this"))
self.assertEqual(result_2['dominant_emotion'], 'anger')
result_3 = emotion_predictor(emotion_detector("I feel disgusted just hearing about this"))
self.assertEqual(result_3['dominant_emotion'], 'disgust')
result_4 = emotion_predictor(emotion_detector("I am so sad about this"))
self.assertEqual(result_4['dominant_emotion'], 'sadness')
result_5 = emotion_predictor(emotion_detector("I am really afraid that this will happen"))
self.assertEqual(result_5['dominant_emotion'], 'fear')
unittest.main()