Repository: climate Updated Branches: refs/heads/master 4c4ff7c70 -> 4e36c1db7
CLIMATE-768 - Fix failing tests in test_dap.py. Add extra logic to dap.py to check for named dimensions. Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/de190c6d Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/de190c6d Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/de190c6d Branch: refs/heads/master Commit: de190c6d7c562c87eadf2ce2645fa744f379f4bf Parents: 4c4ff7c Author: MichaelArthurAnderson <[email protected]> Authored: Fri Feb 26 13:23:58 2016 -0500 Committer: MichaelArthurAnderson <[email protected]> Committed: Fri Feb 26 13:23:58 2016 -0500 ---------------------------------------------------------------------- ocw/tests/test_dap.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/de190c6d/ocw/tests/test_dap.py ---------------------------------------------------------------------- diff --git a/ocw/tests/test_dap.py b/ocw/tests/test_dap.py index 6f9d311..4e20ab5 100644 --- a/ocw/tests/test_dap.py +++ b/ocw/tests/test_dap.py @@ -16,31 +16,33 @@ # under the License. import unittest +import datetime as dt import ocw.data_source.dap as dap from ocw.dataset import Dataset -import datetime as dt + class TestDap(unittest.TestCase): @classmethod - def setup_class(self): - self.url = 'http://test.opendap.org/opendap/data/ncml/agg/dated/CG2006158_120000h_usfc.nc' - self.name = 'foo' - self.dataset = dap.load(self.url, 'CGusfc', name=self.name) + def setUpClass(cls): + + cls.url = 'http://test.opendap.org/opendap/data/ncml/agg/dated/CG2006158_120000h_usfc.nc' + cls.name = 'foo' + cls.dataset = dap.load(cls.url, 'CGusfc', name=cls.name) def test_dataset_is_returned(self): self.assertTrue(isinstance(self.dataset, Dataset)) def test_correct_lat_shape(self): - self.assertEquals(len(self.dataset.lats), 89) + self.assertEquals(len(self.dataset.lats), 29) def test_correct_lon_shape(self): - self.assertEquals(len(self.dataset.lons), 180) + self.assertEquals(len(self.dataset.lons), 26) def test_correct_time_shape(self): - self.assertEquals(len(self.dataset.times), 1857) + self.assertEquals(len(self.dataset.times), 1) def test_valid_date_conversion(self): - start = dt.datetime(1854, 1, 1) + start = dt.datetime(2006, 6, 7, 12) self.assertTrue(start == self.dataset.times[0]) def test_custom_dataset_name(self):
