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 <[email protected]> Authored: Mon Nov 17 09:16:21 2014 -0800 Committer: Michael Joyce <[email protected]> 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"
