示例#1
0
文件: tests.py 项目: storecast/holon
 def test_call_helper_exception(self, transport):
     perform_mock = Mock()
     perform_mock.perform = Mock(side_effect=pycurl.error)
     transport.return_value = perform_mock
     s = PyCurlHttpService('host', 42, 'path')
     with self.assertRaises(s.communication_error_class):
         s._call('body', {})
示例#2
0
文件: tests.py 项目: storecast/holon
 def test_call_helper(self, curl):
     s = PyCurlHttpService('host', 42, 'path')
     r = s._call('body', {})
     self.assertIsInstance(r, tuple)
     self.assertEqual(len(r), 3)