~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Martin Pool
  • Date: 2006-01-13 09:57:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060113095713-1fa5912229a3898e
Review updates of pycurl transport

Split them out into 

  bzrlib.transport.http             common base
  bzrlib.transport.http._urllib     pure python
  bzrlib.transport.http._pycurl     calls pycurl

Update to work with robert's nice transport test multiplexer.

Add PyCurlTransport.has() which does just a HEAD request; should be faster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
807
807
        return LocalTransport(u'.')
808
808
 
809
809
 
810
 
class HttpTransportTest(TestCaseWithWebserver, TestTransportMixIn):
 
810
class UrllibHttpTransportTest(TestCaseWithWebserver, TestTransportMixIn):
 
811
    """Test urllib client against webserver"""
811
812
 
812
813
    readonly = True
813
814
 
814
815
    def get_transport(self):
815
 
        from bzrlib.transport.http import HttpTransport
 
816
        from bzrlib.transport.http._urllib import HttpTransport
816
817
        url = self.get_remote_url(u'.')
817
818
        return HttpTransport(url)
818
819
 
819
820
    def get_bogus_transport(self):
820
 
        from bzrlib.transport.http import HttpTransport
 
821
        from bzrlib.transport.http._urllib import HttpTransport
821
822
        return HttpTransport('http://jasldkjsalkdjalksjdkljasd')
822
823
 
823
824
 
 
825
class PyCurlTransportTest(TestCaseWithWebserver, TestTransportMixIn):
 
826
    """Test pycurl client against webserver"""
 
827
 
 
828
    readonly = True
 
829
 
 
830
    def get_transport(self):
 
831
        from bzrlib.transport.http._pycurl import PyCurlTransport
 
832
        url = self.get_remote_url(u'.')
 
833
        return PyCurlTransport(url)
 
834
 
 
835
    def get_bogus_transport(self):
 
836
        from bzrlib.transport.http._pycurl import PyCurlTransport
 
837
        return PyCurlTransport('http://jasldkjsalkdjalksjdkljasd')
 
838
 
 
839
 
824
840
class TestMemoryTransport(TestCase):
825
841
 
826
842
    def test_get_transport(self):