~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_break_lock.py

Update break-lock blackbox test to not break with dirstate as the default tree format. Unfortunately this slightly reduces test coverage of the UI.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
    def test_break_lock_everything_locked(self):
72
72
        ### if everything is locked, we should be able to unlock the lot.
 
73
        # however, we dont test breaking the working tree because we 
 
74
        # cannot accurately do so right now: the dirstate lock is held 
 
75
        # by an os lock, and we need to spawn a separate process to lock it
 
76
        # thne kill -9 it.
73
77
        # sketch of test:
74
 
        # lock the lot:
75
 
        self.wt.lock_write()
 
78
        # lock most of the dir:
 
79
        self.wt.branch.lock_write()
76
80
        self.master_branch.lock_write()
77
81
        # run the break-lock
78
82
        # we need 5 yes's - wt, branch, repo, bound branch, bound repo.
79
 
        self.run_bzr('break-lock', 'checkout', stdin="y\ny\ny\ny\ny\n")
 
83
        self.run_bzr('break-lock', 'checkout', stdin="y\ny\ny\ny\n")
80
84
        # a new tree instance should be lockable
81
 
        wt = bzrlib.workingtree.WorkingTree.open('checkout')
82
 
        wt.lock_write()
83
 
        wt.unlock()
 
85
        branch = bzrlib.branch.Branch.open('checkout')
 
86
        branch.lock_write()
 
87
        branch.unlock()
84
88
        # and a new instance of the master branch 
85
 
        mb = wt.branch.get_master_branch()
 
89
        mb = branch.get_master_branch()
86
90
        mb.lock_write()
87
91
        mb.unlock()
88
92
        self.assertRaises(errors.LockBroken, self.wt.unlock)