~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1252
1252
        self.failIf(t3.has('b/d'))
1253
1253
 
1254
1254
        if t1.is_readonly():
1255
 
            open('b/d', 'wb').write('newfile\n')
 
1255
            self.build_tree_contents([('b/d', 'newfile\n')])
1256
1256
        else:
1257
1257
            t2.put_bytes('d', 'newfile\n')
1258
1258
 
1338
1338
        self.assertEqual(transport.clone("/").abspath('foo'),
1339
1339
                         transport.abspath("/foo"))
1340
1340
 
 
1341
    def test_win32_abspath(self):
 
1342
        # Note: we tried to set sys.platform='win32' so we could test on
 
1343
        # other platforms too, but then osutils does platform specific
 
1344
        # things at import time which defeated us...
 
1345
        if sys.platform != 'win32':
 
1346
            raise TestSkipped(
 
1347
                'Testing drive letters in abspath implemented only for win32')
 
1348
 
 
1349
        # smoke test for abspath on win32.
 
1350
        # a transport based on 'file:///' never fully qualifies the drive.
 
1351
        transport = get_transport("file:///")
 
1352
        self.failUnlessEqual(transport.abspath("/"), "file:///")
 
1353
 
 
1354
        # but a transport that starts with a drive spec must keep it.
 
1355
        transport = get_transport("file:///C:/")
 
1356
        self.failUnlessEqual(transport.abspath("/"), "file:///C:/")
 
1357
 
1341
1358
    def test_local_abspath(self):
1342
1359
        transport = self.get_transport()
1343
1360
        try:
1546
1563
        content = osutils.rand_bytes(200*1024)
1547
1564
        content_size = len(content)
1548
1565
        if transport.is_readonly():
1549
 
            file('a', 'w').write(content)
 
1566
            self.build_tree_contents([('a', content)])
1550
1567
        else:
1551
1568
            transport.put_bytes('a', content)
1552
1569
        def check_result_data(result_vector):