~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from bzrlib.tests import TestCase
25
25
from bzrlib.transport import Transport
26
26
from bzrlib.transport.http import extract_auth
27
 
from bzrlib.transport.http._urllib import HttpTransport
 
27
from bzrlib.transport.http._urllib import HttpTransport_urllib
28
28
from bzrlib.transport.http._pycurl import PyCurlTransport
29
29
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
30
30
 
49
49
        
50
50
    def test_abs_url(self):
51
51
        """Construction of absolute http URLs"""
52
 
        t = HttpTransport('http://bazaar-ng.org/bzr/bzr.dev/')
 
52
        t = HttpTransport_urllib('http://bazaar-ng.org/bzr/bzr.dev/')
53
53
        eq = self.assertEqualDiff
54
54
        eq(t.abspath('.'),
55
55
           'http://bazaar-ng.org/bzr/bzr.dev')
62
62
 
63
63
    def test_invalid_http_urls(self):
64
64
        """Trap invalid construction of urls"""
65
 
        t = HttpTransport('http://bazaar-ng.org/bzr/bzr.dev/')
 
65
        t = HttpTransport_urllib('http://bazaar-ng.org/bzr/bzr.dev/')
66
66
        self.assertRaises(ValueError,
67
67
            t.abspath,
68
68
            '.bzr/')
72
72
 
73
73
    def test_http_root_urls(self):
74
74
        """Construction of URLs from server root"""
75
 
        t = HttpTransport('http://bzr.ozlabs.org/')
 
75
        t = HttpTransport_urllib('http://bzr.ozlabs.org/')
76
76
        eq = self.assertEqualDiff
77
77
        eq(t.abspath('.bzr/tree-version'),
78
78
           'http://bzr.ozlabs.org/.bzr/tree-version')
93
93
 
94
94
class TestHttpConnections(TestCaseWithWebserver):
95
95
 
96
 
    _transport = HttpTransport
 
96
    _transport = HttpTransport_urllib
97
97
 
98
98
    def setUp(self):
99
99
        super(TestHttpConnections, self).setUp()
142
142
        # urlllib should always be present
143
143
        t = get_transport('http+urllib://bzr.google.com/')
144
144
        self.assertIsInstance(t, Transport)
145
 
        self.assertIsInstance(t, bzrlib.transport.http._urllib.HttpTransport)
 
145
        self.assertIsInstance(t, bzrlib.transport.http._urllib.HttpTransport_urllib)