252
class TestIterChildEntries(TestCaseWithTree):
254
def test_iteration_order(self):
255
work_tree = self.make_branch_and_tree('.')
256
self.build_tree(['a/', 'a/b/', 'a/b/c', 'a/d/', 'a/d/e', 'f/', 'f/g'])
257
work_tree.add(['a', 'a/b', 'a/b/c', 'a/d', 'a/d/e', 'f', 'f/g'])
258
tree = self._convert_tree(work_tree)
259
output = [e.name for e in
260
tree.iter_child_entries(tree.get_root_id())]
261
self.assertEqual(set(['a', 'f']), set(output))
262
output = [e.name for e in
263
tree.iter_child_entries(tree.path2id('a'))]
264
self.assertEqual(set(['b', 'd']), set(output))
266
def test_does_not_exist(self):
267
work_tree = self.make_branch_and_tree('.')
268
self.build_tree(['a/'])
270
tree = self._convert_tree(work_tree)
271
self.assertRaises(errors.NoSuchId, lambda:
272
list(tree.iter_child_entries('unknown')))
252
275
class TestHasId(TestCaseWithTree):
254
277
def test_has_id(self):