~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

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
    )
124
125
                     stdin="y\n")
125
126
        self.assertRaises(errors.LockBroken, self.config.unlock)
126
127
 
 
128
 
 
129
class TestSmartServerBreakLock(tests.TestCaseWithTransport):
 
130
 
 
131
    def test_simple_branch_break_lock(self):
 
132
        self.setup_smart_server_with_call_log()
 
133
        t = self.make_branch_and_tree('branch')
 
134
        t.branch.lock_write()
 
135
        self.reset_smart_call_log()
 
136
        out, err = self.run_bzr(['break-lock', '--force', self.get_url('branch')])
 
137
        # This figure represent the amount of work to perform this use case. It
 
138
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
139
        # being too low. If rpc_count increases, more network roundtrips have
 
140
        # become necessary for this use case. Please do not adjust this number
 
141
        # upwards without agreement from bzr's network support maintainers.
 
142
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
143
        self.assertLength(1, self.hpss_connections)
 
144
        self.assertLength(5, self.hpss_calls)