~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testworkingtree.py

[merge] from robert and fix up tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        tree = WorkingTree(branch.base)
80
80
        self.assertEqual('child',
81
81
                         tree.relpath(os.path.join(os.getcwd(), 'child')))
 
82
 
 
83
    def test_lock_locks_branch(self):
 
84
        branch = Branch.initialize('.')
 
85
        tree = WorkingTree(branch.base)
 
86
        tree.lock_read()
 
87
        self.assertEqual(1, tree.branch._lock_count)
 
88
        self.assertEqual('r', tree.branch._lock_mode)
 
89
        tree.unlock()
 
90
        self.assertEqual(None, tree.branch._lock_count)
 
91
        tree.lock_write()
 
92
        self.assertEqual(1, tree.branch._lock_count)
 
93
        self.assertEqual('w', tree.branch._lock_mode)
 
94
        tree.unlock()
 
95
        self.assertEqual(None, tree.branch._lock_count)