climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1528689 - /incubator/climate/trunk/ocw/tests/test_dap.py
Date Wed, 02 Oct 2013 23:48:30 GMT
Author: joyce
Date: Wed Oct  2 23:48:30 2013
New Revision: 1528689

URL: http://svn.apache.org/r1528689
Log:
CLIMATE-309 - Add valid date conversion unit test.

Modified:
    incubator/climate/trunk/ocw/tests/test_dap.py

Modified: incubator/climate/trunk/ocw/tests/test_dap.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw/tests/test_dap.py?rev=1528689&r1=1528688&r2=1528689&view=diff
==============================================================================
--- incubator/climate/trunk/ocw/tests/test_dap.py (original)
+++ incubator/climate/trunk/ocw/tests/test_dap.py Wed Oct  2 23:48:30 2013
@@ -18,10 +18,10 @@
 import unittest
 import ocw.data_source.dap as dap
 from ocw.dataset import Dataset
+import datetime as dt
 
 class test_dap(unittest.TestCase):
-    def setUp(self):
-        self.dataset = dap.load('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz', 'sst')
+    dataset = dap.load('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz', 'sst')
 
     def test_dataset_is_returned(self):
         self.assertTrue(isinstance(self.dataset, Dataset))
@@ -35,5 +35,9 @@ class test_dap(unittest.TestCase):
     def test_correct_time_shape(self):
         self.assertEquals(len(self.dataset.times), 1857)
 
+    def test_valid_date_conversion(self):
+        start = dt.datetime(1854, 1, 1)
+        self.assertTrue(start == self.dataset.times[0])
+
 if __name__ == '__main__':
     unittest.main()



Mime
View raw message