~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    osutils,
25
25
    tests,
26
26
    )
 
27
from bzrlib.tests.matchers import ContainsNoVfsCalls
27
28
from bzrlib.tests.script import (
28
29
    run_script,
29
30
    )
60
61
        local_branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')
61
62
        local_branch.bind(self.master_branch)
62
63
        checkoutdir = bzrdir.BzrDir.create('checkout')
63
 
        branch.BranchReferenceFormat().initialize(
64
 
            checkoutdir, target_branch=local_branch)
 
64
        checkoutdir.set_branch_reference(local_branch)
65
65
        self.wt = checkoutdir.create_workingtree()
66
66
 
67
67
    def test_break_lock_help(self):
124
124
                     stdin="y\n")
125
125
        self.assertRaises(errors.LockBroken, self.config.unlock)
126
126
 
 
127
 
 
128
class TestSmartServerBreakLock(tests.TestCaseWithTransport):
 
129
 
 
130
    def test_simple_branch_break_lock(self):
 
131
        self.setup_smart_server_with_call_log()
 
132
        t = self.make_branch_and_tree('branch')
 
133
        t.branch.lock_write()
 
134
        self.reset_smart_call_log()
 
135
        out, err = self.run_bzr(['break-lock', '--force', self.get_url('branch')])
 
136
        # This figure represent the amount of work to perform this use case. It
 
137
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
138
        # being too low. If rpc_count increases, more network roundtrips have
 
139
        # become necessary for this use case. Please do not adjust this number
 
140
        # upwards without agreement from bzr's network support maintainers.
 
141
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
142
        self.assertLength(1, self.hpss_connections)
 
143
        self.assertLength(5, self.hpss_calls)