~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Test bogus urls with http in the new infrastructure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
from bzrlib.errors import (NoSuchFile, FileExists,
27
27
                           TransportNotPossible, ConnectionError)
28
 
from bzrlib.tests import TestCase, TestCaseInTempDir
 
28
from bzrlib.tests import TestCaseInTempDir, TestSkipped
29
29
from bzrlib.transport import memory, urlescape
30
30
import bzrlib.transport
31
31
 
541
541
 
542
542
    def test_connection_error(self):
543
543
        """ConnectionError is raised when connection is impossible"""
544
 
        if not hasattr(self, "get_bogus_transport"):
545
 
            return
546
 
        t = self.get_bogus_transport()
 
544
        try:
 
545
            url = self._server.get_bogus_url()
 
546
        except NotImplementedError:
 
547
            raise TestSkipped("Transport %s has no bogus URL support." %
 
548
                              self._server.__class__)
 
549
        t = bzrlib.transport.get_transport(url)
547
550
        try:
548
551
            t.get('.bzr/branch')
549
552
        except (ConnectionError, NoSuchFile), e:
671
674
        self.assertEqual(transport.base + 'relpath',
672
675
                         transport.abspath('relpath'))
673
676
 
674
 
###class HttpTransportTest(TestCaseWithWebserver):
675
 
###
676
 
###    readonly = True
677
 
###
678
 
###    def get_bogus_transport(self):
679
 
###        from bzrlib.transport.http import HttpTransport
680
 
###        return HttpTransport('http://jasldkjsalkdjalksjdkljasd')
681
 
 
682
677
    def test_iter_files_recursive(self):
683
678
        transport = self.get_transport()
684
679
        if not transport.listable():