Skip to content
Snippets Groups Projects
Commit 2944c9c1 authored by Nathan Robert Carlson's avatar Nathan Robert Carlson
Browse files

Unit

parent 465b3d62
Branches
Tags
No related merge requests found
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')
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)
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.')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment