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
250052fb
Commit
250052fb
authored
Mar 14, 2017
by
J. Fernando Sánchez
Browse files
Options as a set in the JSON-LD context
Closes
#18
parent
603e0866
Changes
2
Hide whitespace changes
Inline
Side-by-side
senpy/schemas/context.jsonld
View file @
250052fb
...
...
@@ -40,6 +40,9 @@
"plugins": {
"@container": "@list"
},
"options": {
"@container": "@set"
},
"prov:wasGeneratedBy": {
"@type": "@id"
},
...
...
tests/test_models.py
View file @
250052fb
...
...
@@ -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"""
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment