~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-11-20 22:32:08 UTC
  • mfrom: (2070.5.4 chroot decorator)
  • Revision ID: pqm@pqm.ubuntu.com-20061120223208-fc69d003f4c4a7ac
(Andrew Bennetts) And chroot+ decorator for transports

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(''))
1007
1008
    def test_clone(self):
1008
1009
        # TODO: Test that clone moves up and down the filesystem
1009
1010
        t1 = self.get_transport()
 
1011
        if isinstance(t1, chroot.ChrootTransportDecorator):
 
1012
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1010
1013
 
1011
1014
        self.build_tree(['a', 'b/', 'b/c'], transport=t1)
1012
1015
 
1039
1042
 
1040
1043
    def test_clone_to_root(self):
1041
1044
        orig_transport = self.get_transport()
 
1045
        if isinstance(orig_transport, chroot.ChrootTransportDecorator):
 
1046
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1042
1047
        # Repeatedly go up to a parent directory until we're at the root
1043
1048
        # directory of this transport
1044
1049
        root_transport = orig_transport
1067
1072
    def test_clone_from_root(self):
1068
1073
        """At the root, cloning to a simple dir should just do string append."""
1069
1074
        orig_transport = self.get_transport()
 
1075
        if isinstance(orig_transport, chroot.ChrootTransportDecorator):
 
1076
            raise TestSkipped("ChrootTransportDecorator disallows clone('/')")
1070
1077
        root_transport = orig_transport.clone('/')
1071
1078
        self.assertEqual(root_transport.base + '.bzr/',
1072
1079
            root_transport.clone('.bzr').base)
1087
1094
 
1088
1095
    def test_relpath_at_root(self):
1089
1096
        t = self.get_transport()
 
1097
        if isinstance(t, chroot.ChrootTransportDecorator):
 
1098
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1090
1099
        # clone all the way to the top
1091
1100
        new_transport = t.clone('..')
1092
1101
        while new_transport.base != t.base:
1102
1111
        # that have aliasing problems like symlinks should go in backend
1103
1112
        # specific test cases.
1104
1113
        transport = self.get_transport()
 
1114
        if isinstance(transport, chroot.ChrootTransportDecorator):
 
1115
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1105
1116
        
1106
1117
        self.assertEqual(transport.base + 'relpath',
1107
1118
                         transport.abspath('relpath'))
1126
1137
 
1127
1138
    def test_abspath_at_root(self):
1128
1139
        t = self.get_transport()
 
1140
        if isinstance(t, chroot.ChrootTransportDecorator):
 
1141
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1129
1142
        # clone all the way to the top
1130
1143
        new_transport = t.clone('..')
1131
1144
        while new_transport.base != t.base:
1230
1243
        # check that our server (whatever it is) is accessable reliably
1231
1244
        # via get_transport and multiple connections share content.
1232
1245
        transport = self.get_transport()
 
1246
        if isinstance(transport, chroot.ChrootTransportDecorator):
 
1247
            raise TestSkipped("ChrootTransportDecorator disallows clone('..')")
1233
1248
        if transport.is_readonly():
1234
1249
            return
1235
1250
        transport.put_bytes('foo', 'bar')