Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sentiment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nathan Robert Carlson
sentiment
Commits
2944c9c1
Commit
2944c9c1
authored
8 years ago
by
Nathan Robert Carlson
Browse files
Options
Downloads
Patches
Plain Diff
Unit
parent
465b3d62
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
test_average_file.py
+8
-0
8 additions, 0 deletions
test_average_file.py
test_find.py
+12
-0
12 additions, 0 deletions
test_find.py
test_highest_lowest.py
+8
-0
8 additions, 0 deletions
test_highest_lowest.py
with
28 additions
and
0 deletions
test_average_file.py
0 → 100644
+
8
−
0
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
'
)
This diff is collapsed.
Click to expand it.
test_find.py
0 → 100644
+
12
−
0
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
)
This diff is collapsed.
Click to expand it.
test_highest_lowest.py
0 → 100644
+
8
−
0
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.
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment