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
f21c630f
Commit
f21c630f
authored
Mar 18, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.test: Support more recent JSON Schema validators
parent
32357948
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
slapos/test/test_json_schema.py
slapos/test/test_json_schema.py
+4
-1
No files found.
slapos/test/test_json_schema.py
View file @
f21c630f
...
@@ -45,6 +45,10 @@ def createInstanceParameterSchemaValidatorTest(path):
...
@@ -45,6 +45,10 @@ def createInstanceParameterSchemaValidatorTest(path):
"http://json-schema.org/draft-04/schema#"
:
jsonschema
.
Draft4Validator
,
"http://json-schema.org/draft-04/schema#"
:
jsonschema
.
Draft4Validator
,
"http://json-schema.org/draft-06/schema#"
:
jsonschema
.
Draft6Validator
,
"http://json-schema.org/draft-06/schema#"
:
jsonschema
.
Draft6Validator
,
"http://json-schema.org/draft-07/schema#"
:
jsonschema
.
Draft7Validator
,
"http://json-schema.org/draft-07/schema#"
:
jsonschema
.
Draft7Validator
,
"http://json-schema.org/draft/2019-09/schema"
:
jsonschema
.
Draft201909Validator
,
"http://json-schema.org/draft/2019-09/schema#"
:
jsonschema
.
Draft201909Validator
,
"http://json-schema.org/draft/2020-12/schema"
:
jsonschema
.
Draft202012Validator
,
"http://json-schema.org/draft/2020-12/schema#"
:
jsonschema
.
Draft202012Validator
,
}
}
def
run
(
self
,
*
args
,
**
kwargs
):
def
run
(
self
,
*
args
,
**
kwargs
):
with
open
(
path
,
"r"
)
as
json_file
:
with
open
(
path
,
"r"
)
as
json_file
:
...
@@ -55,7 +59,6 @@ def createInstanceParameterSchemaValidatorTest(path):
...
@@ -55,7 +59,6 @@ def createInstanceParameterSchemaValidatorTest(path):
validator
.
check_schema
(
json_dict
)
validator
.
check_schema
(
json_dict
)
return
run
return
run
def
createSoftwareCfgValidatorTest
(
path
,
software_cfg_schema
):
def
createSoftwareCfgValidatorTest
(
path
,
software_cfg_schema
):
# Test that software json follows the schema for softwares json,
# Test that software json follows the schema for softwares json,
# which is defined in schema.json in this directory
# which is defined in schema.json in this directory
...
...
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