~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_read_working_inventory.py

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for WorkingTree.read_working_inventory."""
18
18
 
19
19
from bzrlib import errors, inventory
 
20
from bzrlib.tests import TestNotApplicable
20
21
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
 
22
from bzrlib.workingtree import InventoryWorkingTree
21
23
 
22
24
 
23
25
class TestReadWorkingInventory(TestCaseWithWorkingTree):
24
26
 
25
27
    def test_trivial_read(self):
26
28
        tree = self.make_branch_and_tree('t1')
 
29
        if not isinstance(tree, InventoryWorkingTree):
 
30
            raise TestNotApplicable("read_working_inventory not usable on "
 
31
                "non-inventory working trees")
27
32
        tree.lock_read()
28
33
        self.assertIsInstance(tree.read_working_inventory(), inventory.Inventory)
29
34
        tree.unlock()
30
35
 
31
36
    def test_read_after_inventory_modification(self):
32
37
        tree = self.make_branch_and_tree('tree')
 
38
        if not isinstance(tree, InventoryWorkingTree):
 
39
            raise TestNotApplicable("read_working_inventory not usable on "
 
40
                "non-inventory working trees")
33
41
        # prepare for a series of changes that will modify the
34
42
        # inventory
35
43
        tree.lock_write()