~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Aaron Bentley
  • Date: 2008-11-07 18:10:32 UTC
  • mto: This revision was merged to the branch mainline in revision 3825.
  • Revision ID: aaron@aaronbentley.com-20081107181032-wggaw45wukuk4u54
Implement copy_tree on copy_tree_to_transport

Show diffs side-by-side

added added

removed removed

Lines of Context:
1437
1437
                         'to/dir/b%2525z',
1438
1438
                         'to/bar',]))
1439
1439
 
 
1440
    def test_copy_tree_to_transport(self):
 
1441
        transport = self.get_transport()
 
1442
        if not transport.listable():
 
1443
            self.assertRaises(TransportNotPossible,
 
1444
                              transport.iter_files_recursive)
 
1445
            return
 
1446
        if transport.is_readonly():
 
1447
            return
 
1448
        self.build_tree(['from/',
 
1449
                         'from/dir/',
 
1450
                         'from/dir/foo',
 
1451
                         'from/dir/bar',
 
1452
                         'from/dir/b%25z', # make sure quoting is correct
 
1453
                         'from/bar'],
 
1454
                        transport=transport)
 
1455
        from_transport = transport.clone('from')
 
1456
        to_transport = transport.clone('to')
 
1457
        to_transport.ensure_base()
 
1458
        from_transport.copy_tree_to_transport(to_transport)
 
1459
        paths = set(transport.iter_files_recursive())
 
1460
        self.assertEqual(paths,
 
1461
                    set(['from/dir/foo',
 
1462
                         'from/dir/bar',
 
1463
                         'from/dir/b%2525z',
 
1464
                         'from/bar',
 
1465
                         'to/dir/foo',
 
1466
                         'to/dir/bar',
 
1467
                         'to/dir/b%2525z',
 
1468
                         'to/bar',]))
 
1469
 
1440
1470
    def test_unicode_paths(self):
1441
1471
        """Test that we can read/write files with Unicode names."""
1442
1472
        t = self.get_transport()