98
101
for pos, item in enumerate(expected_dirblocks):
99
102
self.assertEqual(item, result[pos])
100
103
self.assertEqual(len(expected_dirblocks), len(result))
105
def test_walkdir_versioned_kind(self):
106
work_tree = self.make_branch_and_tree('tree')
107
work_tree.set_root_id('tree-root')
108
self.build_tree(['tree/file', 'tree/dir/'])
109
work_tree.add(['file', 'dir'], ['file-id', 'dir-id'])
110
os.unlink('tree/file')
112
tree = self._convert_tree(work_tree)
114
self.addCleanup(tree.unlock)
115
if tree.path2id('file') is None:
116
raise tests.TestNotApplicable(
117
'Tree type cannot represent dangling ids.')
118
expected = [(('', 'tree-root'), [
119
('dir', 'dir', 'unknown', None, 'dir-id', 'directory'),
120
('file', 'file', 'unknown', None, 'file-id', 'file')]),
121
(('dir', 'dir-id'), [])]
122
self.assertEqual(expected, list(tree.walkdirs()))