451
451
self.requireFeature(features.pycurl)
452
# Import the module locally now that we now it's available.
453
pycurl = features.pycurl.module
453
455
version_info_orig = pycurl.version_info
455
# Now that we have pycurl imported, we can fake its version_info
456
# This was taken from a windows pycurl without SSL
458
pycurl.version_info = lambda : (2,
466
('ftp', 'gopher', 'telnet',
467
'dict', 'ldap', 'http', 'file'),
471
self.assertRaises(errors.DependencyNotPresent, self._transport,
472
'https://launchpad.net')
474
# Restore the right function
475
457
pycurl.version_info = version_info_orig
458
self.addCleanup(restore)
460
# Fake the pycurl version_info This was taken from a windows pycurl
461
# without SSL (thanks to bialix)
462
pycurl.version_info = lambda : (2,
470
('ftp', 'gopher', 'telnet',
471
'dict', 'ldap', 'http', 'file'),
475
self.assertRaises(errors.DependencyNotPresent, self._transport,
476
'https://launchpad.net')
478
479
class TestHTTPConnections(http_utils.TestCaseWithWebserver):