Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
d29c42fd
Commit
d29c42fd
authored
Jan 18, 2018
by
J. Fernando Sánchez
Browse files
Log easy and test serializable
parent
23c88d0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
senpy/utils.py
View file @
d29c42fd
...
...
@@ -71,8 +71,9 @@ def easy_test(plugin_list=None):
logger
.
setLevel
(
logging
.
DEBUG
)
logging
.
getLogger
().
setLevel
(
logging
.
INFO
)
if
not
plugin_list
:
from
.
import
plugins
import
__main__
logger
.
info
(
'Loading classes from {}'
.
format
(
__main__
))
from
.
import
plugins
plugin_list
=
plugins
.
from_module
(
__main__
)
for
plug
in
plugin_list
:
plug
.
test
()
...
...
tests/test_models.py
View file @
d29c42fd
...
...
@@ -9,6 +9,7 @@ from senpy.models import (Emotion,
EmotionAnalysis
,
EmotionSet
,
Entry
,
Entity
,
Error
,
Results
,
Sentiment
,
...
...
@@ -207,3 +208,14 @@ class ModelsTest(TestCase):
recovered
=
from_string
(
string
)
assert
isinstance
(
recovered
,
Results
)
assert
isinstance
(
recovered
.
entries
[
0
],
Entry
)
def
test_serializable
(
self
):
r
=
Results
()
e
=
Entry
()
ent
=
Entity
()
e
.
entities
.
append
(
ent
)
r
.
entries
.
append
(
e
)
d
=
r
.
serializable
()
assert
d
assert
d
[
'entries'
]
assert
d
[
'entries'
][
0
][
'entities'
]
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