~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Max Bowsher
  • Date: 2012-08-08 11:44:19 UTC
  • mfrom: (6552 +trunk)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: _@maxb.eu-20120808114419-hes7at3ihv3mwi16
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
                         output_order)
250
250
 
251
251
 
 
252
class TestIterChildEntries(TestCaseWithTree):
 
253
 
 
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))
 
265
 
 
266
    def test_does_not_exist(self):
 
267
        work_tree = self.make_branch_and_tree('.')
 
268
        self.build_tree(['a/'])
 
269
        work_tree.add(['a'])
 
270
        tree = self._convert_tree(work_tree)
 
271
        self.assertRaises(errors.NoSuchId, lambda:
 
272
            list(tree.iter_child_entries('unknown')))
 
273
 
 
274
 
252
275
class TestHasId(TestCaseWithTree):
253
276
 
254
277
    def test_has_id(self):