~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: 2007-03-28 06:58:22 UTC
  • mfrom: (2379.2.3 hpss-chroot)
  • Revision ID: pqm@pqm.ubuntu.com-20070328065822-999550a858a3ced3
(robertc) Fix chroot urls to not expose the url of the transport they are protecting, allowing regular url operations to work on them. (Robert Collins, Andrew Bennetts)

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