1084
1084
self.assertFinished(client)
1087
class TestBranchGetPhysicalLockStatus(RemoteBranchTestCase):
1089
def test_get_physical_lock_status_yes(self):
1090
transport = MemoryTransport()
1091
client = FakeClient(transport.base)
1092
client.add_expected_call(
1093
'Branch.get_stacked_on_url', ('quack/',),
1094
'error', ('NotStacked',))
1095
client.add_expected_call(
1096
'Branch.get_physical_lock_status', ('quack/',),
1097
'success', ('yes',))
1098
transport.mkdir('quack')
1099
transport = transport.clone('quack')
1100
branch = self.make_remote_branch(transport, client)
1101
result = branch.get_physical_lock_status()
1102
self.assertFinished(client)
1103
self.assertEqual(True, result)
1105
def test_get_physical_lock_status_no(self):
1106
transport = MemoryTransport()
1107
client = FakeClient(transport.base)
1108
client.add_expected_call(
1109
'Branch.get_stacked_on_url', ('quack/',),
1110
'error', ('NotStacked',))
1111
client.add_expected_call(
1112
'Branch.get_physical_lock_status', ('quack/',),
1114
transport.mkdir('quack')
1115
transport = transport.clone('quack')
1116
branch = self.make_remote_branch(transport, client)
1117
result = branch.get_physical_lock_status()
1118
self.assertFinished(client)
1119
self.assertEqual(False, result)
1087
1122
class TestBranchGetParent(RemoteBranchTestCase):
1089
1124
def test_no_parent(self):
2732
2767
self.assertEqual(False, result)
2770
class TestRepositoryPhysicalLockStatus(TestRemoteRepository):
2772
def test_get_physical_lock_status_yes(self):
2773
transport_path = 'qwack'
2774
repo, client = self.setup_fake_client_and_repository(transport_path)
2775
client.add_success_response('yes')
2776
result = repo.get_physical_lock_status()
2778
[('call', 'Repository.get_physical_lock_status',
2781
self.assertEqual(True, result)
2783
def test_get_physical_lock_status_no(self):
2784
transport_path = 'qwack'
2785
repo, client = self.setup_fake_client_and_repository(transport_path)
2786
client.add_success_response('no')
2787
result = repo.get_physical_lock_status()
2789
[('call', 'Repository.get_physical_lock_status',
2792
self.assertEqual(False, result)
2735
2795
class TestRepositoryIsShared(TestRemoteRepository):
2737
2797
def test_is_shared(self):