~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_tree/test_test_trees.py

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the test trees used by the per_tree tests."""
18
18
 
19
 
from bzrlib import tests
20
19
from bzrlib.tests import per_tree
 
20
from bzrlib.tests import (
 
21
    features,
 
22
    )
21
23
 
22
24
 
23
25
class TestTreeShapes(per_tree.TestCaseWithTree):
30
32
        self.assertEqual([], tree.get_parent_ids())
31
33
        self.assertEqual([], tree.conflicts())
32
34
        self.assertEqual([], list(tree.unknowns()))
33
 
        self.assertEqual(['empty-root-id'], list(iter(tree)))
 
35
        self.assertEqual(['empty-root-id'], list(tree.all_file_ids()))
34
36
        self.assertEqual(
35
37
            [('', 'empty-root-id')],
36
38
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
46
48
        # __iter__ has no strongly defined order
47
49
        self.assertEqual(
48
50
            set(['root-id', 'a-id', 'b-id', 'c-id']),
49
 
            set(iter(tree)))
 
51
            set(tree.all_file_ids()))
50
52
        self.assertEqual(
51
53
            [('', 'root-id'), ('a', 'a-id'), ('b', 'b-id'), ('b/c', 'c-id')],
52
54
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
64
66
        # __iter__ has no strongly defined order
65
67
        self.assertEqual(
66
68
            set(['root-id', 'a-id', 'b-id', 'c-id']),
67
 
            set(iter(tree)))
 
69
            set(tree.all_file_ids()))
68
70
        self.assertEqual(
69
71
            [('', 'root-id'), ('a', 'a-id'), ('b', 'b-id'), ('b/c', 'c-id')],
70
72
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
82
84
        # __iter__ has no strongly defined order
83
85
        self.assertEqual(
84
86
            set(['root-id', 'a-id', 'b-id', 'c-id']),
85
 
            set(iter(tree)))
 
87
            set(tree.all_file_ids()))
86
88
        self.assertEqual(
87
89
            [('', 'root-id'), ('a', 'a-id'), ('b', 'b-id'), ('b/c', 'c-id')],
88
90
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
100
102
        # __iter__ has no strongly defined order
101
103
        self.assertEqual(
102
104
            set(['root-id', 'a-id', 'b-id', 'c-id']),
103
 
            set(iter(tree)))
 
105
            set(tree.all_file_ids()))
104
106
        self.assertEqual(
105
107
            [('', 'root-id'), ('b', 'b-id'), ('d', 'a-id'), ('b/c', 'c-id')],
106
108
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
118
120
        # __iter__ has no strongly defined order
119
121
        self.assertEqual(
120
122
            set(['root-id', 'a-id', 'b-id', 'c-id']),
121
 
            set(iter(tree)))
 
123
            set(tree.all_file_ids()))
122
124
        self.assertEqual(
123
125
            [('', 'root-id'), ('b', 'b-id'), ('d', 'a-id'), ('b/c', 'c-id')],
124
126
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
136
138
        # __iter__ has no strongly defined order
137
139
        self.assertEqual(
138
140
            set(['root-id', 'a-id', 'b-id', 'c-id']),
139
 
            set(iter(tree)))
 
141
            set(tree.all_file_ids()))
140
142
        self.assertEqual(
141
143
            [('', 'root-id'), ('a', 'a-id'), ('b', 'b-id'), ('e', 'c-id')],
142
144
            [(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
147
149
        # currently this test tree requires unicode. It might be good
148
150
        # to have it simply stop having the single unicode file in it
149
151
        # when dealing with a non-unicode filesystem.
150
 
        self.requireFeature(tests.SymlinkFeature)
 
152
        self.requireFeature(features.SymlinkFeature)
151
153
        tree = self.get_tree_with_subdirs_and_all_content_types()
152
154
        tree.lock_read()
153
155
        self.addCleanup(tree.unlock)
165
167
                 u'0utf\u1234file'.encode('utf8'),
166
168
                'symlink',
167
169
                 ]),
168
 
            set(iter(tree)))
 
170
            set(tree.all_file_ids()))
169
171
        # note that the order of the paths and fileids is deliberately
170
172
        # mismatched to ensure that the result order is path based.
171
173
        self.assertEqual(
198
200
                '0dir-in-1topdir',
199
201
                 u'0utf\u1234file'.encode('utf8'),
200
202
                 ]),
201
 
            set(iter(tree)))
 
203
            set(tree.all_file_ids()))
202
204
        # note that the order of the paths and fileids is deliberately
203
205
        # mismatched to ensure that the result order is path based.
204
206
        self.assertEqual(