/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

Tests shouldn't assume os.listdir returns sorted results
The manual specifically says it doesn't.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
504
504
    def test_copy_basic_tree(self):
505
505
        self.build_tree(['source/', 'source/a', 'source/b/', 'source/b/c'])
506
506
        osutils.copy_tree('source', 'target')
507
 
        self.assertEqual(['a', 'b'], os.listdir('target'))
 
507
        self.assertEqual(['a', 'b'], sorted(os.listdir('target')))
508
508
        self.assertEqual(['c'], os.listdir('target/b'))
509
509
 
510
510
    def test_copy_tree_target_exists(self):
511
511
        self.build_tree(['source/', 'source/a', 'source/b/', 'source/b/c',
512
512
                         'target/'])
513
513
        osutils.copy_tree('source', 'target')
514
 
        self.assertEqual(['a', 'b'], os.listdir('target'))
 
514
        self.assertEqual(['a', 'b'], sorted(os.listdir('target')))
515
515
        self.assertEqual(['c'], os.listdir('target/b'))
516
516
 
517
517
    def test_copy_tree_symlinks(self):