~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-08-01 04:55:10 UTC
  • mto: (3363.17.4 merge-into)
  • mto: This revision was merged to the branch mainline in revision 3736.
  • Revision ID: aaron@aaronbentley.com-20080801045510-bkud24q1syjvmk00
Change Tree.__contains__ to tolerate subclasssing

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        self.addCleanup(tree.unlock)
238
238
        self.assertTrue(tree.has_id('file-id'))
239
239
        self.assertFalse(tree.has_id('dir-id'))
 
240
 
 
241
    def test___contains__(self):
 
242
        work_tree = self.make_branch_and_tree('tree')
 
243
        self.build_tree(['tree/file'])
 
244
        work_tree.add('file', 'file-id')
 
245
        tree = self._convert_tree(work_tree)
 
246
        tree.lock_read()
 
247
        self.addCleanup(tree.unlock)
 
248
        self.assertTrue('file-id' in tree)
 
249
        self.assertFalse('dir-id' in tree)