Fix uploadTestCase to work even when HTTPSConnection is not available.
This commit is contained in:
parent
72b8502992
commit
f7520dc0d7
|
@ -72,13 +72,13 @@ class uploadTestCase(PyPIRCCommandTestCase):
|
|||
|
||||
def setUp(self):
|
||||
super(uploadTestCase, self).setUp()
|
||||
self.old_class = httpclient.HTTPSConnection
|
||||
if hasattr(httpclient, 'HTTPSConnection'):
|
||||
self.addCleanup(setattr, httpclient, 'HTTPSConnection',
|
||||
httpclient.HTTPSConnection)
|
||||
else:
|
||||
self.addCleanup(delattr, httpclient, 'HTTPSConnection')
|
||||
self.conn = httpclient.HTTPSConnection = FakeConnection()
|
||||
|
||||
def tearDown(self):
|
||||
httpclient.HTTPSConnection = self.old_class
|
||||
super(uploadTestCase, self).tearDown()
|
||||
|
||||
def test_finalize_options(self):
|
||||
|
||||
# new format
|
||||
|
|
Loading…
Reference in New Issue