~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge with get_file_sha1

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
 
241
251
        self.assertEqual(expected, list(tree.extras()))
242
252
 
243
253
 
244
 
class TestHasId(TestCaseWithTree):
245
 
 
246
 
    def test_has_id(self):
247
 
        work_tree = self.make_branch_and_tree('tree')
248
 
        self.build_tree(['tree/file'])
249
 
        work_tree.add('file', 'file-id')
250
 
        tree = self._convert_tree(work_tree)
251
 
        tree.lock_read()
252
 
        self.addCleanup(tree.unlock)
253
 
        self.assertTrue(tree.has_id('file-id'))
254
 
        self.assertFalse(tree.has_id('dir-id'))
255
 
 
256
 
    def test___contains__(self):
257
 
        work_tree = self.make_branch_and_tree('tree')
258
 
        self.build_tree(['tree/file'])
259
 
        work_tree.add('file', 'file-id')
260
 
        tree = self._convert_tree(work_tree)
261
 
        tree.lock_read()
262
 
        self.addCleanup(tree.unlock)
263
 
        self.assertTrue('file-id' in tree)
264
 
        self.assertFalse('dir-id' in tree)
265
 
 
266
 
 
267
254
class TestGetFileSha1(TestCaseWithTree):
268
255
 
269
256
    def test_get_file_sha1(self):