/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 17:48:22 UTC
  • mto: (4987.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125174822-nce4l19sbwx83jvq
Deploying the new overrideAttr facility further reduces the complexity
and make the code clearer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
        # Import the module locally now that we now it's available.
453
453
        pycurl = features.pycurl.module
454
454
 
455
 
        self.addAttrCleanup(pycurl, 'version_info')
456
 
        # Fake the pycurl version_info This was taken from a windows pycurl
457
 
        # without SSL (thanks to bialix)
458
 
        pycurl.version_info = lambda : (2,
459
 
                                        '7.13.2',
460
 
                                        462082,
461
 
                                        'i386-pc-win32',
462
 
                                        2576,
463
 
                                        None,
464
 
                                        0,
465
 
                                        None,
466
 
                                        ('ftp', 'gopher', 'telnet',
467
 
                                         'dict', 'ldap', 'http', 'file'),
468
 
                                        None,
469
 
                                        0,
470
 
                                        None)
 
455
        self.overrideAttr(pycurl, 'version_info',
 
456
                          # Fake the pycurl version_info This was taken from
 
457
                          # a windows pycurl without SSL (thanks to bialix)
 
458
                          lambda : (2,
 
459
                                    '7.13.2',
 
460
                                    462082,
 
461
                                    'i386-pc-win32',
 
462
                                    2576,
 
463
                                    None,
 
464
                                    0,
 
465
                                    None,
 
466
                                    ('ftp', 'gopher', 'telnet',
 
467
                                     'dict', 'ldap', 'http', 'file'),
 
468
                                    None,
 
469
                                    0,
 
470
                                    None))
471
471
        self.assertRaises(errors.DependencyNotPresent, self._transport,
472
472
                          'https://launchpad.net')
473
473
 
1360
1360
 
1361
1361
 
1362
1362
def install_redirected_request(test):
1363
 
    test.addAttrCleanup(_urllib2_wrappers, 'Request')
1364
 
    _urllib2_wrappers.Request = RedirectedRequest
 
1363
    test.overrideAttr(_urllib2_wrappers, 'Request', RedirectedRequest)
1365
1364
 
1366
1365
 
1367
1366
class TestHTTPSilentRedirections(http_utils.TestCaseWithRedirectedWebserver):