def test_unpatch(self): """ When unpatching httplib we restore the correct module/methods """ original_init = httplib.HTTPConnection.__init__.__wrapped__ original_putrequest = httplib.HTTPConnection.putrequest.__wrapped__ original_getresponse = httplib.HTTPConnection.getresponse.__wrapped__ unpatch() self.assertEqual(httplib.HTTPConnection.__init__, original_init) self.assertEqual(httplib.HTTPConnection.putrequest, original_putrequest) self.assertEqual(httplib.HTTPConnection.getresponse, original_getresponse)
def test_unpatch(self): """ When unpatching httplib we restore the correct module/methods """ original_init = httplib.HTTPConnection.__init__.__wrapped__ original_request = httplib.HTTPConnection.request.__wrapped__ original_getresponse = httplib.HTTPConnection.getresponse.__wrapped__ unpatch() self.assertEqual(httplib.HTTPConnection.__init__, original_init) self.assertEqual(httplib.HTTPConnection.request, original_request) self.assertEqual(httplib.HTTPConnection.getresponse, original_getresponse)
def tearDown(self): unpatch() super(HTTPLibBaseMixin, self).tearDown()
def tearDown(self): unpatch()