From cec5c11be71943877d2b51410c2f035c44d3b679 Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Thu, 13 Aug 2020 16:10:16 +0200
Subject: [PATCH] test of load_json_docs

---
 test/test_general_routes.py | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/test/test_general_routes.py b/test/test_general_routes.py
index a6a915e9..bc3fe999 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)
-- 
GitLab