~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Andrew Bennetts
  • Date: 2006-10-12 06:09:28 UTC
  • mto: (2018.3.1 hpss HTTP support)
  • mto: This revision was merged to the branch mainline in revision 2143.
  • Revision ID: andrew.bennetts@canonical.com-20061012060928-e387650ef98b70f5
Add ChrootTransportDecorator.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
from bzrlib.symbol_versioning import zero_eleven
39
39
from bzrlib.tests import TestCaseInTempDir, TestSkipped
40
40
from bzrlib.tests.test_transport import TestTransportImplementation
41
 
from bzrlib.transport import memory, smart
 
41
from bzrlib.transport import memory, smart, chroot
42
42
import bzrlib.transport
43
43
 
44
44
 
94
94
 
95
95
    def test_has_root_works(self):
96
96
        current_transport = self.get_transport()
97
 
        # import pdb;pdb.set_trace()
 
97
        if isinstance(current_transport, chroot.ChrootTransportDecorator):
 
98
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
98
99
        self.assertTrue(current_transport.has('/'))
99
100
        root = current_transport.clone('/')
100
101
        self.assertTrue(root.has(''))
1012
1013
    def test_clone(self):
1013
1014
        # TODO: Test that clone moves up and down the filesystem
1014
1015
        t1 = self.get_transport()
 
1016
        if isinstance(t1, chroot.ChrootTransportDecorator):
 
1017
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1015
1018
 
1016
1019
        self.build_tree(['a', 'b/', 'b/c'], transport=t1)
1017
1020
 
1044
1047
 
1045
1048
    def test_clone_to_root(self):
1046
1049
        orig_transport = self.get_transport()
 
1050
        if isinstance(orig_transport, chroot.ChrootTransportDecorator):
 
1051
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1047
1052
        # Repeatedly go up to a parent directory until we're at the root
1048
1053
        # directory of this transport
1049
1054
        root_transport = orig_transport
1072
1077
    def test_clone_from_root(self):
1073
1078
        """At the root, cloning to a simple dir should just do string append."""
1074
1079
        orig_transport = self.get_transport()
 
1080
        if isinstance(orig_transport, chroot.ChrootTransportDecorator):
 
1081
            raise TestSkipped("ChrootTransportDecorator disallows clone('/')")
1075
1082
        root_transport = orig_transport.clone('/')
1076
1083
        self.assertEqual(root_transport.base + '.bzr/',
1077
1084
            root_transport.clone('.bzr').base)
1092
1099
 
1093
1100
    def test_relpath_at_root(self):
1094
1101
        t = self.get_transport()
 
1102
        if isinstance(t, chroot.ChrootTransportDecorator):
 
1103
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1095
1104
        # clone all the way to the top
1096
1105
        new_transport = t.clone('..')
1097
1106
        while new_transport.base != t.base:
1128
1137
 
1129
1138
    def test_abspath_at_root(self):
1130
1139
        t = self.get_transport()
 
1140
        if isinstance(t, chroot.ChrootTransportDecorator):
 
1141
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1131
1142
        # clone all the way to the top
1132
1143
        new_transport = t.clone('..')
1133
1144
        while new_transport.base != t.base:
1232
1243
        # check that our server (whatever it is) is accessable reliably
1233
1244
        # via get_transport and multiple connections share content.
1234
1245
        transport = self.get_transport()
 
1246
        if isinstance(transport, chroot.ChrootTransportDecorator):
 
1247
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1235
1248
        if transport.is_readonly():
1236
1249
            return
1237
1250
        transport.put_bytes('foo', 'bar')