예제 #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))
예제 #2
0
파일: test_clients.py 프로젝트: mxr/nsq-py
 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))
예제 #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")
예제 #4
0
파일: test_clients.py 프로젝트: mxr/nsq-py
 def test_json_wrap_basic(self):
     '''Returns JSON-parsed content'''
     self.result.content = '{"data":"bar"}'
     self.assertEqual(http.json_wrap(self.function)(), 'bar')