127
127
[(path, node.file_id) for path, node in tree.iter_entries_by_dir()])
128
128
self.assertEqualDiff('contents of a\n', tree.get_file_text('a-id'))
129
129
self.assertTrue(tree.is_executable('c-id'))
131
def test_tree_with_subdirs_and_all_content_types(self):
132
# currently this test tree requires unicode. It might be good
133
# to have it simply stop having the single unicode file in it
134
# when dealing with a non-unicode filesystem.
135
tree = self.get_tree_with_subdirs_and_all_content_types()
136
self.assertEqual([], tree.get_parent_ids())
137
self.assertEqual([], tree.conflicts())
138
self.assertEqual([], list(tree.unknowns()))
139
# __iter__ has no strongly defined order
141
set([inventory.ROOT_ID,
150
# note that the order of the paths and fileids is deliberately
151
# mismatched to ensure that the result order is path based.
153
[('', inventory.ROOT_ID, 'directory'),
154
('0file', '2file', 'file'),
155
('1top-dir', '1top-dir', 'directory'),
156
(u'2utf\u1234file', u'0utf\u1234file', 'file'),
157
('symlink', 'symlink', 'symlink'),
158
('1top-dir/0file-in-1topdir', '1file-in-1topdir', 'file'),
159
('1top-dir/1dir-in-1topdir', '0dir-in-1topdir', 'directory')],
160
[(path, node.file_id, node.kind) for path, node in tree.iter_entries_by_dir()])