/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_memorytree.py

  • Committer: Robert Collins
  • Date: 2006-09-15 02:03:15 UTC
  • mto: (2017.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2018.
  • Revision ID: robertc@robertcollins.net-20060915020315-9a4b022a6db42940
Update to bzr.dev, which involves adding lock_tree_write to MutableTree and MemoryTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            tree.get_file(tree.path2id('foo')).read())
53
53
        tree.unlock()
54
54
 
 
55
    def test_lock_tree_write(self):
 
56
        """Check we can lock_tree_write and unlock MemoryTrees."""
 
57
        branch = self.make_branch('branch')
 
58
        tree = MemoryTree.create_on_branch(branch)
 
59
        tree.lock_tree_write()
 
60
        tree.unlock()
 
61
 
 
62
    def test_lock_tree_write_after_read_fails(self):
 
63
        """Check that we error when trying to upgrade a read lock to write."""
 
64
        branch = self.make_branch('branch')
 
65
        tree = MemoryTree.create_on_branch(branch)
 
66
        tree.lock_read()
 
67
        self.assertRaises(errors.ReadOnlyError, tree.lock_tree_write)
 
68
        tree.unlock()
 
69
 
55
70
    def test_lock_write(self):
56
71
        """Check we can lock_write and unlock MemoryTrees."""
57
72
        branch = self.make_branch('branch')