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 2013/10/03 01:48:30 UTC
svn commit: r1528689 - /incubator/climate/trunk/ocw/tests/test_dap.py
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()