146
148
# currently this test tree requires unicode. It might be good
147
149
# to have it simply stop having the single unicode file in it
148
150
# when dealing with a non-unicode filesystem.
151
if not has_symlinks():
152
raise TestSkipped('No symlink support')
149
153
tree = self.get_tree_with_subdirs_and_all_content_types()
151
155
self.addCleanup(tree.unlock)
176
180
('1top-dir/1dir-in-1topdir', '0dir-in-1topdir', 'directory')],
177
181
[(path, node.file_id, node.kind) for path, node in tree.iter_entries_by_dir()])
183
def test_tree_with_subdirs_and_all_content_types_wo_symlinks(self):
184
# currently this test tree requires unicode. It might be good
185
# to have it simply stop having the single unicode file in it
186
# when dealing with a non-unicode filesystem.
187
tree = self.get_tree_with_subdirs_and_all_supported_content_types(False)
189
self.addCleanup(tree.unlock)
190
self.assertEqual([], tree.get_parent_ids())
191
self.assertEqual([], tree.conflicts())
192
self.assertEqual([], list(tree.unknowns()))
193
# __iter__ has no strongly defined order
194
tree_root = tree.path2id('')
201
u'0utf\u1234file'.encode('utf8'),
204
# note that the order of the paths and fileids is deliberately
205
# mismatched to ensure that the result order is path based.
207
[('', tree_root, 'directory'),
208
('0file', '2file', 'file'),
209
('1top-dir', '1top-dir', 'directory'),
210
(u'2utf\u1234file', u'0utf\u1234file'.encode('utf8'), 'file'),
211
('1top-dir/0file-in-1topdir', '1file-in-1topdir', 'file'),
212
('1top-dir/1dir-in-1topdir', '0dir-in-1topdir', 'directory')],
213
[(path, node.file_id, node.kind) for path, node in tree.iter_entries_by_dir()])
179
215
def test_tree_with_utf8(self):
180
216
tree = self.make_branch_and_tree('.')
181
217
tree = self.get_tree_with_utf8(tree)