~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testworkingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2005-10-19 09:34:39 UTC
  • mfrom: (1185.16.78)
  • mto: (1185.16.102)
  • mto: This revision was merged to the branch mainline in revision 1488.
  • Revision ID: jelmer@samba.org-20051019093439-e1d8e3508d1ba46b
MergeĀ fromĀ Martin

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)