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
Léo-Paul Géneau
slapos
Commits
003508e0
Commit
003508e0
authored
Feb 16, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_json_schema: resolve `request` and `response` schemas
So that the test fail if they are missing.
parent
a0762813
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
slapos/test/test_json_schema.py
slapos/test/test_json_schema.py
+10
-1
No files found.
slapos/test/test_json_schema.py
View file @
003508e0
...
...
@@ -59,7 +59,16 @@ def createSoftwareCfgValidatorTest(path, software_cfg_schema):
# which is defined in schema.json in this directory
def
run
(
self
,
*
args
,
**
kwargs
):
with
open
(
path
,
"r"
)
as
json_file
:
jsonschema
.
validate
(
json
.
load
(
json_file
),
software_cfg_schema
)
schema
=
json
.
load
(
json_file
)
jsonschema
.
validate
(
schema
,
software_cfg_schema
)
# also make sure request and response schemas can be resolved
schema
.
setdefault
(
'$id'
,
'file://'
+
path
)
resolver
=
jsonschema
.
RefResolver
.
from_schema
(
schema
)
for
software_type_definition
in
schema
[
'software-type'
].
itervalues
():
resolver
.
resolve
(
software_type_definition
[
'request'
])
resolver
.
resolve
(
software_type_definition
[
'response'
])
return
run
...
...
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