/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

Merge from TestCaseWithMemoryTransport.

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')