diff --git a/test_average_file.py b/test_average_file.py new file mode 100644 index 0000000000000000000000000000000000000000..5ceadf8cce2a9c05a1626ab00342f4b5db4f7d15 --- /dev/null +++ b/test_average_file.py @@ -0,0 +1,8 @@ +from unittest import TestCase +from sentiment import * + +class TestAverage_file(TestCase): + def test_average_file(self): + x = average_file() + print('example.txt') + self.assertEquals(x, 'The average score of words in examples.txt is 1.78747550712. The overrall sentiment of examples.txt is Negative') diff --git a/test_find.py b/test_find.py new file mode 100644 index 0000000000000000000000000000000000000000..14bfb4ef2364d178af86947ba310baa3937775b9 --- /dev/null +++ b/test_find.py @@ -0,0 +1,12 @@ +from unittest import TestCase +from sentiment import * + + +class TestFind(TestCase): + def test_find01(self): + x = find('arty') + self.assertEquals(x, 1.25) + + def test_find02(self): + x = find('scramble') + self.assertEquals(x, 0) diff --git a/test_highest_lowest.py b/test_highest_lowest.py new file mode 100644 index 0000000000000000000000000000000000000000..c5dff1238db827e87446f892d1c1b95a10e315ea --- /dev/null +++ b/test_highest_lowest.py @@ -0,0 +1,8 @@ +from unittest import TestCase +from sentiment import * + +class TestHighest_lowest(TestCase): + def test_highest_lowest(self): + x = highest_lowest() + print('examples.txt') + self.assertEquals(x, 'The most positive word is "and" with a score of 2.26130653266. \nThe most negative word is "bad" with a score of 0.885135135135.')