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/29 01:49:00 UTC
svn commit: r1562336 -
/incubator/climate/trunk/ocw-ui/backend/tests/test_local_file_metadata_extractors.py
Author: joyce
Date: Wed Jan 29 00:49:00 2014
New Revision: 1562336
URL: http://svn.apache.org/r1562336
Log:
CLIMATE-326 - Add failure jsonp variable 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=1562336&r1=1562335&r2=1562336&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 Wed Jan 29 00:49:00 2014
@@ -192,5 +192,20 @@ class TestVariableExtraction(unittest.Te
self.assertDictEqual(expected_return, response.json)
+ def test_failure_variable_extract_jsonp(self):
+ expected_return = {'success': False}
+
+ response = test_app.get('/lfme/list_vars//fakepath?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()