From 8d9e7ff45dcc92116f3c6fc06c4b075fbdc73871 Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Sun, 14 Jul 2019 16:48:38 +0200
Subject: [PATCH] added test of latchdb route

---
 test/test_job_routes.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/test_job_routes.py b/test/test_job_routes.py
index 427ceafd..237d304c 100644
--- a/test/test_job_routes.py
+++ b/test/test_job_routes.py
@@ -1,6 +1,7 @@
 import json
 import jsonschema
 
+from inventory_provider.tasks.common import DB_LATCH_SCHEMA
 DEFAULT_REQUEST_HEADERS = {
     "Content-type": "application/json",
     "Accept": ["application/json"]
@@ -123,3 +124,13 @@ def test_check_task_status_exception(client, mocker):
     assert not status['success']
     assert status['result']['error type'] == 'AssertionError'
     assert status['result']['message'] == 'test error message'
+
+
+def test_latchdb(client, mocked_redis):
+
+    rv = client.post(
+        'jobs/latchdb',
+        headers=DEFAULT_REQUEST_HEADERS)
+    assert rv.status_code == 200
+    latch = json.loads(rv.data.decode('utf-8'))
+    jsonschema.validate(latch, DB_LATCH_SCHEMA)
-- 
GitLab