1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 13:08:13 +00:00

Options as a set in the JSON-LD context

Closes #18
This commit is contained in:
J. Fernando Sánchez 2017-03-14 13:17:09 +01:00
parent 603e086606
commit 250052fb99
2 changed files with 14 additions and 1 deletions

View File

@ -40,6 +40,9 @@
"plugins": {
"@container": "@list"
},
"options": {
"@container": "@set"
},
"prov:wasGeneratedBy": {
"@type": "@id"
},

View File

@ -97,7 +97,15 @@ class ModelsTest(TestCase):
def test_plugins(self):
self.assertRaises(Error, plugins.Plugin)
p = plugins.Plugin({"name": "dummy", "version": 0})
p = plugins.Plugin({"name": "dummy",
"version": 0,
"extra_params": {
"none": {
"options": ["es", ],
"required": False,
"default": "0"
}
}})
c = p.jsonld()
assert "info" not in c
assert "repo" not in c
@ -105,6 +113,8 @@ class ModelsTest(TestCase):
logging.debug("Framed:")
logging.debug(c)
p.validate()
assert "es" in c['extra_params']['none']['options']
assert isinstance(c['extra_params']['none']['options'], list)
def test_str(self):
"""The string representation shouldn't include private variables"""