Skip to content
Snippets Groups Projects
Commit 64d72600 authored by Erik Reid's avatar Erik Reid
Browse files

use expected schema to verify returned data

parent 2d977537
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ def test_version_request(client, mocked_redis):
def test_load_json_docs(data_config, mocked_redis):
INTERFACE_SCHEMA = interfaces_list_schema = {
INTERFACE_SCHEMA = {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
......@@ -65,7 +65,6 @@ def test_load_json_docs(data_config, mocked_redis):
"properties": {
"name": {"type": "string"},
"description": {"type": "string"},
"router": {"type": "string"},
"bundle": {
"type": "array",
"items": {"type": "string"}
......@@ -79,12 +78,20 @@ def test_load_json_docs(data_config, mocked_redis):
"items": {"type": "string"}
}
},
"required": ["name", "description", "router", "ipv4", "ipv6"],
"required": ["name", "description", "ipv4", "ipv6"],
"additionalProperties": False
}
}
},
"type": "object",
"properties": {
"key": {"type": "string"},
"value": {"$ref": "#/definitions/interface"}
},
"required": ["key", "value"],
"additionalProperties": False
}
for ifc in common.load_json_docs(data_config, 'netconf-interfaces:*', num_threads=20):
print(ifc)
for ifc in common.load_json_docs(
data_config, 'netconf-interfaces:*', num_threads=20):
jsonschema.validate(ifc, INTERFACE_SCHEMA)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment