コード例 #1
0
ファイル: test_clients.py プロジェクト: pombredanne/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))
コード例 #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
ファイル: test_clients.py プロジェクト: pombredanne/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")
コード例 #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')