Fix uploadTestCase to work even when HTTPSConnection is not available.

This commit is contained in:
Ezio Melotti 2013-04-19 04:23:09 +03:00
parent 72b8502992
commit f7520dc0d7
1 changed files with 5 additions and 5 deletions

View File

@ -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