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', {})
def test_call_helper(self, curl): s = PyCurlHttpService('host', 42, 'path') r = s._call('body', {}) self.assertIsInstance(r, tuple) self.assertEqual(len(r), 3)