From 18caa5eeee1768998856ab288cef1021ee87eecb Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Wed, 12 Feb 2020 15:13:58 +0100
Subject: [PATCH] improve test schema

---
 test/test_classifier_routes.py   | 19 ++++++++++++++++++-
 test/test_infinera_classifier.py | 19 ++++++++++++++++++-
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/test/test_classifier_routes.py b/test/test_classifier_routes.py
index 56821fcb..caee5904 100644
--- a/test/test_classifier_routes.py
+++ b/test/test_classifier_routes.py
@@ -132,6 +132,23 @@ JUNIPER_LINK_METADATA_DEFINITIONS = {
         #     "equipment", "logical_unit", "card_id", "interface_name"
         # ],
         "additionalProperties": False
+    },
+    "related-service-info": {
+        "type": "object",
+        "properties": {
+            "name": {"type": "string"},
+            "status": {
+                "type": "string",
+                "enum": ["operational", "installed", "planned", "ordered"]
+            },
+            "circuit_type": {
+                "type": "string",
+                "enum": ["path", "service", "l2circuit"]
+            },
+            "project": {"type": "string"}
+        },
+        "required": ["name", "status", "circuit_type", "project"],
+        "additionalProperties": False
     }
 }
 
@@ -152,7 +169,7 @@ JUNIPER_LINK_METADATA = {
         "interface": {"$ref": "#/definitions/interface-info"},
         "related-services": {
             "type": "array",
-            "items": {"$ref": "#/definitions/service-info"}
+            "items": {"$ref": "#/definitions/related-service-info"}
         },
         "locations": {"$ref": "#/definitions/locations-list"}
     },
diff --git a/test/test_infinera_classifier.py b/test/test_infinera_classifier.py
index d3794028..6e0621a0 100644
--- a/test/test_infinera_classifier.py
+++ b/test/test_infinera_classifier.py
@@ -82,6 +82,23 @@ INFINERA_LINK_METADATA_DEFINITIONS = {
         },
         "additionalProperties": False
     },
+    "related-service-info": {
+        "type": "object",
+        "properties": {
+            "name": {"type": "string"},
+            "status": {
+                "type": "string",
+                "enum": ["operational", "installed", "planned", "ordered"]
+            },
+            "circuit_type": {
+                "type": "string",
+                "enum": ["path", "service", "l2circuit"]
+            },
+            "project": {"type": "string"}
+        },
+        "required": ["name", "status", "circuit_type", "project"],
+        "additionalProperties": False
+    },
     "geant-lambda": {
         "type": "object",
         "properties": {
@@ -113,7 +130,7 @@ INFINERA_LINK_METADATA = {
         },
         "related-services": {
             "type": "array",
-            "items": {"$ref": "#/definitions/service-info"}
+            "items": {"$ref": "#/definitions/related-service-info"}
         },
         "geant-lambda": {
             "$ref": "#/definitions/geant-lambda"
-- 
GitLab