You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by ea...@apache.org on 2020/06/11 23:56:48 UTC

[incubator-sdap-ingester] branch tests updated: unit tests wip

This is an automated email from the ASF dual-hosted git repository.

eamonford pushed a commit to branch tests
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git


The following commit(s) were added to refs/heads/tests by this push:
     new 3b1a468  unit tests wip
3b1a468 is described below

commit 3b1a46817e53076f3f0a99455a63c3c2fa805f57
Author: Eamon Ford <ea...@jpl.nasa.gov>
AuthorDate: Thu Jun 11 16:56:14 2020 -0700

    unit tests wip
---
 .../tests/resources/collections_alternate.yml           | 17 +++++++++++++++++
 .../tests/services/test_CollectionWatcher.py            | 13 +++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/collection_manager/tests/resources/collections_alternate.yml b/collection_manager/tests/resources/collections_alternate.yml
new file mode 100644
index 0000000..3d7da95
--- /dev/null
+++ b/collection_manager/tests/resources/collections_alternate.yml
@@ -0,0 +1,17 @@
+collections:
+  - id: TELLUS_GRACE_MASCON_CRI_GRID_RL05_V2_LAND
+    path: /opt/data/grace/*land*.nc
+    variable: lwe_thickness
+    priority: 1
+    forward-processing-priority: 5
+
+  - id: ID_CHANGED
+    path: /opt/data/grace/*ocean*.nc
+    variable: lwe_thickness
+    priority: 2
+    forward-processing-priority: 6
+
+  - id: AVHRR_OI-NCEI-L4-GLOB-v2.0
+    path: /opt/data/avhrr/*.nc
+    variable: analysed_sst
+    priority: 1
diff --git a/collection_manager/tests/services/test_CollectionWatcher.py b/collection_manager/tests/services/test_CollectionWatcher.py
index 1b86be0..cb9d38a 100644
--- a/collection_manager/tests/services/test_CollectionWatcher.py
+++ b/collection_manager/tests/services/test_CollectionWatcher.py
@@ -62,7 +62,16 @@ class TestCollectionWatcher(unittest.TestCase):
         self.assertEquals(len(updated_collections), 0)
 
     def test_get_updated_collections_returns_some_collections(self):
-        ...
+        collections_path = os.path.join(os.path.dirname(__file__), '../resources/collections.yml')
+        collection_watcher = CollectionWatcher(collections_path, Mock(), Mock())
+        collection_watcher._load_collections()
+
+        new_collections_path = os.path.join(os.path.dirname(__file__), '../resources/collections_alternate.yml')
+        collection_watcher._collections_path = new_collections_path
+        updated_collections = collection_watcher._get_updated_collections()
+
+        self.assertEquals(len(updated_collections), 1)
 
     def test_schedule_watches(self):
-        ...
+        collections_path = os.path.join(os.path.dirname(__file__), '../resources/collections.yml')
+        collection_watcher = CollectionWatcher(collections_path, Mock(), Mock())