~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2008-09-08 20:33:27 UTC
  • mto: (3363.13.5 extras)
  • mto: This revision was merged to the branch mainline in revision 3715.
  • Revision ID: aaron@aaronbentley.com-20080908203327-pr4ajs9fjtlk9av7
Add HasId test

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        output_order = [p for p, e in tree.iter_entries_by_dir()]
204
204
        self.assertEqual(['', 'a', 'f', 'a/b', 'a/d', 'a/b/c', 'a/d/e', 'f/g'],
205
205
                         output_order)
 
206
 
 
207
 
 
208
class TestHasId(TestCaseWithTree):
 
209
 
 
210
    def test_has_id(self):
 
211
        work_tree = self.make_branch_and_tree('tree')
 
212
        self.build_tree(['tree/file'])
 
213
        work_tree.add('file', 'file-id')
 
214
        tree = self._convert_tree(work_tree)
 
215
        tree.lock_read()
 
216
        self.addCleanup(tree.unlock)
 
217
        self.assertTrue(tree.has_id('file-id'))
 
218
        self.assertFalse(tree.has_id('dir-id'))