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

test of load_json_docs

parent fa1eaac2
No related branches found
No related tags found
No related merge requests found
import json
import jsonschema
from inventory_provider.routes import common
DEFAULT_REQUEST_HEADERS = {
"Content-type": "application/json",
"Accept": ["application/json"]
......@@ -50,3 +52,39 @@ def test_version_request(client, mocked_redis):
jsonschema.validate(
json.loads(rv.data.decode("utf-8")),
version_schema)
def test_load_json_docs(data_config, mocked_redis):
INTERFACE_SCHEMA = interfaces_list_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"interface": {
"type": "object",
"properties": {
"name": {"type": "string"},
"description": {"type": "string"},
"router": {"type": "string"},
"bundle": {
"type": "array",
"items": {"type": "string"}
},
"ipv4": {
"type": "array",
"items": {"type": "string"}
},
"ipv6": {
"type": "array",
"items": {"type": "string"}
}
},
"required": ["name", "description", "router", "ipv4", "ipv6"],
"additionalProperties": False
}
}
}
for ifc in common.load_json_docs(data_config, 'netconf-interfaces:*', num_threads=20):
print(ifc)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment