-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestIramuteq.py
27 lines (22 loc) · 955 Bytes
/
testIramuteq.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
from InputHandler import WhatsappConversationAnalysis
from util import load_stop_words, load_Iramuteq
class TestStopWords(unittest.TestCase):
def test_load_Iramuteq(self):
iramuteq = load_Iramuteq("word-equivalent")
self.assertTrue(isinstance(iramuteq, dict))
self.assertTrue(len(iramuteq) > 0)
def test_import_Iramuteq_from_text_file(self):
original_file = "cookie acústica acústicas acústico acústicos"
expected = "cookie acústico acústico acústico acústico "
w = WhatsappConversationAnalysis()
processed_file = w._apply_Iramuteq(original_file)
self.assertEqual(processed_file, expected)
def test_empty_input_file(self):
original_file = ""
w = WhatsappConversationAnalysis()
expected = "please input a body of text in order to apply the Iramuteq filter"
processed_file = w._apply_Iramuteq(original_file)
self.assertEqual(processed_file, expected)
if __name__ == '__main__':
unittest.main()