diff --git a/test/test_general_routes.py b/test/test_general_routes.py index a6a915e95e0412641280c155f09d0d31f519c90f..bc3fe9992e1fd54df9640a48f959eda85f2cca33 100644 --- a/test/test_general_routes.py +++ b/test/test_general_routes.py @@ -1,6 +1,8 @@ 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)