~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-29 23:51:44 UTC
  • mfrom: (3363.17.14 merge-into)
  • Revision ID: pqm@pqm.ubuntu.com-20080929235144-2jweo1007kh31723
Enable merging into PreviewTrees

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
        self.assertTrue(tree.has_id('file-id'))
221
221
        self.assertFalse(tree.has_id('dir-id'))
222
222
 
 
223
    def test___contains__(self):
 
224
        work_tree = self.make_branch_and_tree('tree')
 
225
        self.build_tree(['tree/file'])
 
226
        work_tree.add('file', 'file-id')
 
227
        tree = self._convert_tree(work_tree)
 
228
        tree.lock_read()
 
229
        self.addCleanup(tree.unlock)
 
230
        self.assertTrue('file-id' in tree)
 
231
        self.assertFalse('dir-id' in tree)
 
232
 
223
233
 
224
234
class TestExtras(TestCaseWithTree):
225
235
 
240
250
        self.addCleanup(tree.unlock)
241
251
        self.assertEqual(expected, list(tree.extras()))
242
252
 
243
 
class TestHasId(TestCaseWithTree):
244
 
 
245
 
    def test_has_id(self):
246
 
        work_tree = self.make_branch_and_tree('tree')
247
 
        self.build_tree(['tree/file'])
248
 
        work_tree.add('file', 'file-id')
249
 
        tree = self._convert_tree(work_tree)
250
 
        tree.lock_read()
251
 
        self.addCleanup(tree.unlock)
252
 
        self.assertTrue(tree.has_id('file-id'))
253
 
        self.assertFalse(tree.has_id('dir-id'))
254
 
 
255
 
    def test___contains__(self):
256
 
        work_tree = self.make_branch_and_tree('tree')
257
 
        self.build_tree(['tree/file'])
258
 
        work_tree.add('file', 'file-id')
259
 
        tree = self._convert_tree(work_tree)
260
 
        tree.lock_read()
261
 
        self.addCleanup(tree.unlock)
262
 
        self.assertTrue('file-id' in tree)
263
 
        self.assertFalse('dir-id' in tree)
264
 
 
265
253
 
266
254
class TestGetFileSha1(TestCaseWithTree):
267
255