~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Patch Queue Manager
  • Date: 2011-11-25 13:09:37 UTC
  • mfrom: (6280.4.9 hpss-break-lock)
  • Revision ID: pqm@pqm.ubuntu.com-20111125130937-9b1kbg3t983cm80o
(jelmer) Add HPSS call for ``Repository.break_lock`` and
 ``Branch.break_lock``. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1038
1038
        return RemoteBranch(bzrdir, repo, _client=client, format=format)
1039
1039
 
1040
1040
 
 
1041
class TestBranchBreakLock(RemoteBranchTestCase):
 
1042
 
 
1043
    def test_break_lock(self):
 
1044
        transport_path = 'quack'
 
1045
        transport = MemoryTransport()
 
1046
        client = FakeClient(transport.base)
 
1047
        client.add_expected_call(
 
1048
            'Branch.get_stacked_on_url', ('quack/',),
 
1049
            'error', ('NotStacked',))
 
1050
        client.add_expected_call(
 
1051
            'Branch.break_lock', ('quack/',),
 
1052
            'success', ('ok',))
 
1053
        transport.mkdir('quack')
 
1054
        transport = transport.clone('quack')
 
1055
        branch = self.make_remote_branch(transport, client)
 
1056
        branch.break_lock()
 
1057
        self.assertFinished(client)
 
1058
 
 
1059
 
1041
1060
class TestBranchGetParent(RemoteBranchTestCase):
1042
1061
 
1043
1062
    def test_no_parent(self):
2204
2223
                         result)
2205
2224
 
2206
2225
 
 
2226
class TestRepositoryBreakLock(TestRemoteRepository):
 
2227
 
 
2228
    def test_break_lock(self):
 
2229
        transport_path = 'quack'
 
2230
        repo, client = self.setup_fake_client_and_repository(transport_path)
 
2231
        client.add_success_response('ok')
 
2232
        repo.break_lock()
 
2233
        self.assertEqual(
 
2234
            [('call', 'Repository.break_lock', ('quack/',))],
 
2235
            client._calls)
 
2236
 
 
2237
 
2207
2238
class TestRepositoryGetGraph(TestRemoteRepository):
2208
2239
 
2209
2240
    def test_get_graph(self):