~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-07 17:21:55 UTC
  • mto: (1908.2.1 commit-perf)
  • mto: This revision was merged to the branch mainline in revision 1923.
  • Revision ID: john@arbash-meinel.com-20060807172155-62ec9d7e15e34adb
create a copy_tree wrapper around walkdirs()

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
            sorted(original_paths, cmp=osutils.compare_paths_prefix_order))
421
421
 
422
422
 
 
423
class TestCopyTree(TestCaseInTempDir):
 
424
    
 
425
    def test_copy_basic_tree(self):
 
426
        self.build_tree(['source/', 'source/a', 'source/b/', 'source/b/c'])
 
427
        osutils.copy_tree('source', 'target')
 
428
        self.assertEqual(['a', 'b'], os.listdir('target'))
 
429
        self.assertEqual(['c'], os.listdir('target/b'))
 
430
 
 
431
    def test_copy_tree_target_exists(self):
 
432
        self.build_tree(['source/', 'source/a', 'source/b/', 'source/b/c',
 
433
                         'target/'])
 
434
        osutils.copy_tree('source', 'target')
 
435
        self.assertEqual(['a', 'b'], os.listdir('target'))
 
436
        self.assertEqual(['c'], os.listdir('target/b'))
 
437
 
 
438
 
423
439
class TestTerminalEncoding(TestCase):
424
440
    """Test the auto-detection of proper terminal encoding."""
425
441