/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: Martin Pool
  • Date: 2010-06-24 06:53:06 UTC
  • mfrom: (5317 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5343.
  • Revision ID: mbp@sourcefrog.net-20100624065306-qcx1wg84ufuckime
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
391
391
        self.assertEqual('http://example.com', url)
392
392
        self.assertEqual(0, len(f.credentials))
393
393
        url = http.extract_auth(
394
 
            'http://user:pass@www.bazaar-vcs.org/bzr/bzr.dev', f)
395
 
        self.assertEqual('http://www.bazaar-vcs.org/bzr/bzr.dev', url)
 
394
            'http://user:pass@example.com/bzr/bzr.dev', f)
 
395
        self.assertEqual('http://example.com/bzr/bzr.dev', url)
396
396
        self.assertEqual(1, len(f.credentials))
397
 
        self.assertEqual([None, 'www.bazaar-vcs.org', 'user', 'pass'],
 
397
        self.assertEqual([None, 'example.com', 'user', 'pass'],
398
398
                         f.credentials[0])
399
399
 
400
400
 
452
452
        # Import the module locally now that we now it's available.
453
453
        pycurl = features.pycurl.module
454
454
 
455
 
        version_info_orig = pycurl.version_info
456
 
        def restore():
457
 
            pycurl.version_info = version_info_orig
458
 
        self.addCleanup(restore)
459
 
 
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,
463
 
                                        '7.13.2',
464
 
                                        462082,
465
 
                                        'i386-pc-win32',
466
 
                                        2576,
467
 
                                        None,
468
 
                                        0,
469
 
                                        None,
470
 
                                        ('ftp', 'gopher', 'telnet',
471
 
                                         'dict', 'ldap', 'http', 'file'),
472
 
                                        None,
473
 
                                        0,
474
 
                                        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))
475
471
        self.assertRaises(errors.DependencyNotPresent, self._transport,
476
472
                          'https://launchpad.net')
477
473
 
1361
1357
 
1362
1358
 
1363
1359
def install_redirected_request(test):
1364
 
    test.original_class = _urllib2_wrappers.Request
1365
 
    def restore():
1366
 
        _urllib2_wrappers.Request = test.original_class
1367
 
    _urllib2_wrappers.Request = RedirectedRequest
1368
 
    test.addCleanup(restore)
 
1360
    test.overrideAttr(_urllib2_wrappers, 'Request', RedirectedRequest)
1369
1361
 
1370
1362
 
1371
1363
class TestHTTPSilentRedirections(http_utils.TestCaseWithRedirectedWebserver):