Example #1
0
 def test_json_wrap_exception(self):
     """Raises a generalized exception for failed 200s"""
     # This is not JSON
     self.result.content = '{"'
     self.assertRaises(http.ClientException, http.json_wrap(self.function))
Example #2
0
 def test_json_wrap_exception(self):
     '''Raises a generalized exception for failed 200s'''
     # This is not JSON
     self.result.content = '{"'
     self.assertRaises(http.ClientException, http.json_wrap(self.function))
Example #3
0
 def test_json_wrap_basic(self):
     """Returns JSON-parsed content"""
     self.result.content = '{"data":"bar"}'
     self.assertEqual(http.json_wrap(self.function)(), "bar")
Example #4
0
 def test_json_wrap_basic(self):
     '''Returns JSON-parsed content'''
     self.result.content = '{"data":"bar"}'
     self.assertEqual(http.json_wrap(self.function)(), 'bar')