From 395e69d8563b26f81d214a39ea0a26c38f2cfc87 Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Fri, 19 Jul 2019 15:08:15 +0200
Subject: [PATCH] added a small test

---
 test/test_celery_worker_global.py | 12 ++++++++++++
 test/test_testing_routes.py       | 11 ++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/test/test_celery_worker_global.py b/test/test_celery_worker_global.py
index a67d07c4..1d9a0b9c 100644
--- a/test/test_celery_worker_global.py
+++ b/test/test_celery_worker_global.py
@@ -58,6 +58,12 @@ def test_InventoryTask_obj(data_config_filename):
 
 
 def test_next_redis(data_config, mocked_redis):
+    """
+    not a very meaningful test ... basically only for sanity & coverage
+    :param data_config:
+    :param mocked_redis:
+    :return:
+    """
     common.set_latch(data_config, 10, 20)
     r = common.get_next_redis(data_config)
     assert r
@@ -69,6 +75,12 @@ def test_next_redis(data_config, mocked_redis):
 
 
 def test_next_redis_with_none(data_config, mocked_redis):
+    """
+    not a very meaningful test ... basically only for sanity & coverage
+    :param data_config:
+    :param mocked_redis:
+    :return:
+    """
     r = common._get_redis(data_config)
     assert r
 
diff --git a/test/test_testing_routes.py b/test/test_testing_routes.py
index 17a910a2..045a6068 100644
--- a/test/test_testing_routes.py
+++ b/test/test_testing_routes.py
@@ -28,7 +28,7 @@ def test_juniper_addresses(client):
     assert len(response_data) > 0  # test data is not empty
 
 
-def test_get_equipment_location(client):
+def test_get_equipment_location_all(client):
     rv = client.get(
         '/testing/opsdb/equipment-location',
         headers=DEFAULT_REQUEST_HEADERS)
@@ -81,3 +81,12 @@ def test_get_parents(client):
     assert rv.status_code == 200
     assert rv.is_json
     # TODO: validate against schema
+
+
+def test_get_equipment_location(client):
+    rv = client.get(
+        '/testing/opsdb/equipment-location/mx1.ams.nl.geant.net',
+        headers=DEFAULT_REQUEST_HEADERS)
+    assert rv.status_code == 200
+    assert rv.is_json
+    # TODO: validate against schema
-- 
GitLab