Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos
Commits
13afbf86
Commit
13afbf86
authored
Feb 24, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! test_json_schema: resolve `request` and `response` schemas
use six for python3 compatibility
parent
fe89f1e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
slapos/test/test_json_schema.py
slapos/test/test_json_schema.py
+7
-5
No files found.
slapos/test/test_json_schema.py
View file @
13afbf86
...
@@ -25,14 +25,16 @@
...
@@ -25,14 +25,16 @@
#
#
##############################################################################
##############################################################################
import
unittest
import
collections
import
os
import
glob
import
glob
import
json
import
json
import
collections
import
os
import
slapos.test
import
unittest
import
jsonschema
import
jsonschema
import
six
import
slapos.test
def
createInstanceParameterSchemaValidatorTest
(
path
):
def
createInstanceParameterSchemaValidatorTest
(
path
):
# Test that json is a valid json schema, supports several
# Test that json is a valid json schema, supports several
...
@@ -65,7 +67,7 @@ def createSoftwareCfgValidatorTest(path, software_cfg_schema):
...
@@ -65,7 +67,7 @@ def createSoftwareCfgValidatorTest(path, software_cfg_schema):
# also make sure request and response schemas can be resolved
# also make sure request and response schemas can be resolved
schema
.
setdefault
(
'$id'
,
'file://'
+
path
)
schema
.
setdefault
(
'$id'
,
'file://'
+
path
)
resolver
=
jsonschema
.
RefResolver
.
from_schema
(
schema
)
resolver
=
jsonschema
.
RefResolver
.
from_schema
(
schema
)
for
software_type_definition
in
s
chema
[
'software-type'
].
itervalues
(
):
for
software_type_definition
in
s
ix
.
itervalues
(
schema
[
'software-type'
]
):
resolver
.
resolve
(
software_type_definition
[
'request'
])
resolver
.
resolve
(
software_type_definition
[
'request'
])
resolver
.
resolve
(
software_type_definition
[
'response'
])
resolver
.
resolve
(
software_type_definition
[
'response'
])
...
...
Write
Preview
Markdown
is supported
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