Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nathan Robert Carlson
sentiment
Commits
2944c9c1
Commit
2944c9c1
authored
Feb 20, 2017
by
Nathan Robert Carlson
Browse files
Unit
parent
465b3d62
Changes
3
Hide whitespace changes
Inline
Side-by-side
test_average_file.py
0 → 100644
View file @
2944c9c1
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'
)
test_find.py
0 → 100644
View file @
2944c9c1
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
)
test_highest_lowest.py
0 → 100644
View file @
2944c9c1
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.
\n
The most negative word is "bad" with a score of 0.885135135135.'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment