climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1562268 - /incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py
Date Tue, 28 Jan 2014 22:19:38 GMT
Author: joyce
Date: Tue Jan 28 22:19:38 2014
New Revision: 1562268

URL: http://svn.apache.org/r1562268
Log:
Add failure lfme/lis_latlon jsonp 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=1562268&r1=1562267&r2=1562268&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:19:38 2014
@@ -63,5 +63,25 @@ class TestLatLonExtraction(unittest.Test
 
         self.assertDictEqual(expected_return, response.json)
 
+    def test_failure_latlon_extract_jsonp(self):
+        expected_return = {
+            "success": False,
+            "variables": ["invalid_lon", "invalid_time", "invalid_lat"]
+        }
+
+        file_location = os.path.abspath('tests/example_data/lat_lon_time_invalid.nc')
+
+        response = test_app.get('/lfme/list_latlon/' + file_location + '?callback=test_callback')
+        json = response.text
+
+        # Strip out the callback functino and the json string from the response
+        # and check for proper content.
+        callback = json[:json.index('(')]
+        json = json[json.index('(') + 1 : json.rindex(')')]
+        json = literal_eval(json)
+
+        self.assertDictEqual(expected_return, json)
+        self.assertEqual(callback, "test_callback")
+
 if __name__ == '__main__':
     unittest.main()



Mime
View raw message