You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2015/03/05 18:15:58 UTC

[3/9] climate git commit: CLIMATE-594 - Add tests for Dataset attribute changes

CLIMATE-594 - Add tests for Dataset attribute changes

- Add attribute test for Dataset 'name' since this was missing.
- Add test for new Dataset 'origin' attribute.


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/b02d74c6
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/b02d74c6
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/b02d74c6

Branch: refs/heads/master
Commit: b02d74c6a07e6225502ee1acc80d5dd1dad9d431
Parents: d4f2b50
Author: Michael Joyce <jo...@apache.org>
Authored: Fri Feb 27 10:46:27 2015 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Fri Feb 27 10:46:27 2015 -0800

----------------------------------------------------------------------
 ocw/tests/test_dataset.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/b02d74c6/ocw/tests/test_dataset.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_dataset.py b/ocw/tests/test_dataset.py
index 94d7740..3edbe83 100644
--- a/ocw/tests/test_dataset.py
+++ b/ocw/tests/test_dataset.py
@@ -30,8 +30,11 @@ class TestDatasetAttributes(unittest.TestCase):
         flat_array = np.array(range(300))
         self.value = flat_array.reshape(12, 5, 5)
         self.variable = 'prec'
+        self.name = 'foo'
+        self.origin = {'path': '/a/fake/file/path'}
         self.test_dataset = Dataset(self.lat, self.lon, self.time, 
-                                    self.value, self.variable)
+                                    self.value, self.variable,
+                                    self.name, self.origin)
 
     def test_lats(self):
         self.assertItemsEqual(self.test_dataset.lats, self.lat)
@@ -48,6 +51,12 @@ class TestDatasetAttributes(unittest.TestCase):
     def test_variable(self):
         self.assertEqual(self.test_dataset.variable, self.variable)
 
+    def test_name(self):
+        self.assertEqual(self.test_dataset.name, self.name)
+
+    def test_origin(self):
+        self.assertEqual(self.test_dataset.origin, self.origin)
+
 class TestInvalidDatasetInit(unittest.TestCase):
     def setUp(self):
         self.lat = np.array([10, 12, 14, 16, 18])