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/01/28 23:21:05 UTC
svn commit: r1562283 -
/incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py
Author: joyce
Date: Tue Jan 28 22:21:04 2014
New Revision: 1562283
URL: http://svn.apache.org/r1562283
Log:
CLIMATE-326 - Add successful lfme time extract test.
Modified:
incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py
Modified: incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py?rev=1562283&r1=1562282&r2=1562283&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py Tue Jan 28 22:21:04 2014
@@ -83,5 +83,20 @@ class TestLatLonExtraction(unittest.Test
self.assertDictEqual(expected_return, json)
self.assertEqual(callback, "test_callback")
+class TestTimeExtraction(unittest.TestCase):
+ def test_successful_time_extract(self):
+ expected_return = {
+ "success": True,
+ "time_name": "time",
+ "start_time": "1988-06-10 00:00:00",
+ "end_time": "2008-01-27 00:00:00"
+ }
+
+ file_location = os.path.abspath('tests/example_data/lat_lon_time.nc')
+
+ response = test_app.get('/lfme/list_time/' + file_location)
+
+ self.assertDictEqual(expected_return, response.json)
+
if __name__ == '__main__':
unittest.main()