~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2011-06-14 02:21:41 UTC
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110614022141-18hmm7s0iw3utcbj
Deprecate __contains__ on Tree and Inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    )
25
25
from bzrlib.tests import TestSkipped
26
26
from bzrlib.tests.per_tree import TestCaseWithTree
 
27
from bzrlib.symbol_versioning import (
 
28
    deprecated_in,
 
29
    )
 
30
 
27
31
 
28
32
class TestAnnotate(TestCaseWithTree):
29
33
 
94
98
        tree.lock_read()
95
99
        self.addCleanup(tree.unlock)
96
100
        path = tree.id2path('sub-root')
97
 
        self.assertEqual('sub-1', tree.get_reference_revision('sub-root', path))
 
101
        self.assertEqual('sub-1',
 
102
            tree.get_reference_revision('sub-root', path))
98
103
 
99
104
    def test_iter_references(self):
100
105
        tree = self.create_nested()
257
262
        tree = self._convert_tree(work_tree)
258
263
        tree.lock_read()
259
264
        self.addCleanup(tree.unlock)
260
 
        self.assertTrue('file-id' in tree)
261
 
        self.assertFalse('dir-id' in tree)
 
265
        self.assertTrue(
 
266
            self.applyDeprecated(
 
267
                deprecated_in((2, 4, 0)),
 
268
                tree.__contains__, 'file-id'))
 
269
        self.assertFalse(
 
270
            self.applyDeprecated(
 
271
                deprecated_in((2, 4, 0)),
 
272
                tree.__contains__, 'dir-id'))
262
273
 
263
274
 
264
275
class TestExtras(TestCaseWithTree):