mirror of
https://github.com/gsi-upm/senpy
synced 2025-09-18 04:22:21 +00:00
Several fixes
* Refactored BaseModel for efficiency * Added plugin metaclass to keep track of plugin types * Moved plugins to examples dir (in a previous commit) * Simplified validation in parse_params * Added convenience methods to mock requests in tests * Changed help schema to use `.valid_parameters` instead of `.parameters`, which was used in results to show parameters provided by the user. * Improved UI * Added basic parameters * Fixed bugs in parameter handling * Refactored and cleaned code
This commit is contained in:
@@ -106,7 +106,7 @@ class ExtensionsTest(TestCase):
|
||||
r2 = analyse(self.senpy, input="tupni", output="tuptuo")
|
||||
assert r1.analysis[0] == "plugins/Dummy_0.1"
|
||||
assert r2.analysis[0] == "plugins/Dummy_0.1"
|
||||
assert r1.entries[0]['nif:iString'] == 'input'
|
||||
assert r1.entries[0]['nif:isString'] == 'input'
|
||||
|
||||
def test_analyse_jsonld(self):
|
||||
""" Using a plugin with JSON-LD input"""
|
||||
@@ -130,7 +130,7 @@ class ExtensionsTest(TestCase):
|
||||
output="tuptuo")
|
||||
assert r1.analysis[0] == "plugins/Dummy_0.1"
|
||||
assert r2.analysis[0] == "plugins/Dummy_0.1"
|
||||
assert r1.entries[0]['nif:iString'] == 'input'
|
||||
assert r1.entries[0]['nif:isString'] == 'input'
|
||||
|
||||
def test_analyse_error(self):
|
||||
mm = mock.MagicMock()
|
||||
@@ -185,7 +185,7 @@ class ExtensionsTest(TestCase):
|
||||
response = Results({
|
||||
'analysis': [{'plugin': plugin}],
|
||||
'entries': [Entry({
|
||||
'nif:iString': 'much ado about nothing',
|
||||
'nif:isString': 'much ado about nothing',
|
||||
'emotions': [eSet1]
|
||||
})]
|
||||
})
|
||||
|
Reference in New Issue
Block a user