/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/workingtree_implementations/test_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-31 05:56:58 UTC
  • mfrom: (1711.2.28 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060531055658-2fa78bd860286282
[patch] Lalo Martins: add python path information to bzr --version

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
class TestWorkingTree(TestCaseWithWorkingTree):
39
39
 
40
 
    def test_listfiles(self):
 
40
    def test_list_files(self):
41
41
        tree = self.make_branch_and_tree('.')
42
 
        os.mkdir('dir')
43
 
        print >> open('file', 'w'), "content"
 
42
        self.build_tree(['dir/', 'file'])
44
43
        if has_symlinks():
45
44
            os.symlink('target', 'symlink')
46
45
        files = list(tree.list_files())
49
48
        if has_symlinks():
50
49
            self.assertEqual(files[2], ('symlink', '?', 'symlink', None, TreeLink()))
51
50
 
 
51
    def test_list_files_sorted(self):
 
52
        tree = self.make_branch_and_tree('.')
 
53
        self.build_tree(['dir/', 'file', 'dir/file', 'dir/b', 'dir/subdir/', 'a', 'dir/subfile',
 
54
                'zz_dir/', 'zz_dir/subfile'])
 
55
        files = [(path, kind) for (path, versioned, kind, file_id, entry) in tree.list_files()]
 
56
        self.assertEqual([
 
57
            ('a', 'file'),
 
58
            ('dir', 'directory'),
 
59
            ('file', 'file'),
 
60
            ('zz_dir', 'directory'),
 
61
            ], files)
 
62
 
 
63
        tree.add(['dir', 'zz_dir'])
 
64
        files = [(path, kind) for (path, versioned, kind, file_id, entry) in tree.list_files()]
 
65
        self.assertEqual([
 
66
            ('a', 'file'),
 
67
            ('dir', 'directory'),
 
68
            ('dir/b', 'file'),
 
69
            ('dir/file', 'file'),
 
70
            ('dir/subdir', 'directory'),
 
71
            ('dir/subfile', 'file'),
 
72
            ('file', 'file'),
 
73
            ('zz_dir', 'directory'),
 
74
            ('zz_dir/subfile', 'file'),
 
75
            ], files)
 
76
 
52
77
    def test_open_containing(self):
53
78
        branch = self.make_branch_and_tree('.').branch
54
79
        wt, relpath = WorkingTree.open_containing()