/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-10-12 07:24:46 UTC
  • mto: This revision was merged to the branch mainline in revision 5487.
  • Revision ID: mbp@sourcefrog.net-20101012072446-cnxz39kdn4ig9to8
Cope gracefully if urllib2 doesn't tell us the port number in the authentication callback

Show diffs side-by-side

added added

removed removed

Lines of Context:
1663
1663
 
1664
1664
 
1665
1665
 
1666
 
class TestUrllib2AuthHandler(tests.TestCase):
 
1666
class TestUrllib2AuthHandler(tests.TestCaseWithTransport):
1667
1667
    """Unit tests for glue by which urllib2 asks us for authentication"""
1668
1668
 
1669
1669
    def test_get_user_password_without_port(self):
1675
1675
        password = 'foo'
1676
1676
        _setup_authentication_config(
1677
1677
            scheme='http', 
1678
 
            port=80,
1679
1678
            host='localhost',
1680
1679
            user=user,
1681
1680
            password=password)
1682
 
        handler = _urllib2_wrappers.AbstractAuthHandler()
 
1681
        handler = _urllib2_wrappers.HTTPAuthHandler()
1683
1682
        got_pass = handler.get_user_password(dict(
 
1683
            user='joe',
1684
1684
            protocol='http',
1685
1685
            host='localhost',
1686
1686
            path='/',
1687
1687
            realm='Realm',
1688
1688
            ))
1689
 
        self.assertEquals(password, got_pass)
 
1689
        self.assertEquals((user, password), got_pass)
1690
1690
 
1691
1691
 
1692
1692
class TestProxyAuth(TestAuth):