From 418f9f1aa4e5d32852a9376de0a150363cbec215 Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Tue, 25 Dec 2018 11:43:58 +0100
Subject: [PATCH] re-enable /data/version test outside of per-router config

---
 test/per_router/test_data_routes.py | 27 -----------------------
 test/test_data_routes.py            | 34 +++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 27 deletions(-)
 create mode 100644 test/test_data_routes.py

diff --git a/test/per_router/test_data_routes.py b/test/per_router/test_data_routes.py
index 14065597..500dc1f0 100644
--- a/test/per_router/test_data_routes.py
+++ b/test/per_router/test_data_routes.py
@@ -18,33 +18,6 @@ DEFAULT_REQUEST_HEADERS = {
 }
 
 
-# def test_version_request(router, client):
-#     version_schema = {
-#         "$schema": "http://json-schema.org/draft-07/schema#",
-#         "type": "object",
-#         "properties": {
-#             "api": {
-#                 "type": "string",
-#                 "pattern": r'\d+\.\d+'
-#             },
-#             "module": {
-#                 "type": "string",
-#                 "pattern": r'\d+\.\d+'
-#             }
-#         },
-#         "required": ["api", "module"],
-#         "additionalProperties": False
-#     }
-#
-#     rv = client.post(
-#         "data/version",
-#         headers=DEFAULT_REQUEST_HEADERS)
-#     assert rv.status_code == 200
-#     jsonschema.validate(
-#         json.loads(rv.data.decode("utf-8")),
-#         version_schema)
-
-
 class MockedRedis(object):
 
     db = None
diff --git a/test/test_data_routes.py b/test/test_data_routes.py
new file mode 100644
index 00000000..7f51fcca
--- /dev/null
+++ b/test/test_data_routes.py
@@ -0,0 +1,34 @@
+import json
+import jsonschema
+
+DEFAULT_REQUEST_HEADERS = {
+    "Content-type": "application/json",
+    "Accept": ["application/json"]
+}
+
+
+def test_version_request(client):
+    version_schema = {
+        "$schema": "http://json-schema.org/draft-07/schema#",
+        "type": "object",
+        "properties": {
+            "api": {
+                "type": "string",
+                "pattern": r'\d+\.\d+'
+            },
+            "module": {
+                "type": "string",
+                "pattern": r'\d+\.\d+'
+            }
+        },
+        "required": ["api", "module"],
+        "additionalProperties": False
+    }
+
+    rv = client.post(
+        "data/version",
+        headers=DEFAULT_REQUEST_HEADERS)
+    assert rv.status_code == 200
+    jsonschema.validate(
+        json.loads(rv.data.decode("utf-8")),
+        version_schema)
-- 
GitLab