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 2014/11/19 17:53:17 UTC

[02/21] climate git commit: CLIMATE-372 - Testing local custom dataset name test

CLIMATE-372 - Testing local custom dataset name test


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

Branch: refs/heads/master
Commit: f6f1dd6843cb1ff5aa3068d01b9c570c54a3920d
Parents: aefdffe
Author: Michael Joyce <jo...@apache.org>
Authored: Mon Nov 17 09:16:21 2014 -0800
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Nov 17 09:16:21 2014 -0800

----------------------------------------------------------------------
 ocw/tests/test_local.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/f6f1dd68/ocw/tests/test_local.py
----------------------------------------------------------------------
diff --git a/ocw/tests/test_local.py b/ocw/tests/test_local.py
index ac49485..27f4245 100644
--- a/ocw/tests/test_local.py
+++ b/ocw/tests/test_local.py
@@ -64,6 +64,11 @@ class test_load_file(unittest.TestCase):
         new_values = self.values[0,:,:,:]
         self.assertTrue(numpy.allclose(local.load_file(self.file_path, "value").values, new_values))
 
+    def test_custom_dataset_name(self):
+        '''Test adding a custom name to a dataset'''
+        ds = local.load_file(self.file_path, 'value', name='foo')
+        self.assertEqual(ds.name, 'foo')
+
 class test_get_netcdf_variable_names(unittest.TestCase):
     file_path = "http://zipper.jpl.nasa.gov/dist/"
     test_model = "AFRICA_KNMI-RACMO2.2b_CTL_ERAINT_MM_50km_1989-2008_tasmax.nc"