Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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")
Exemplo n.º 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')