/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

Merge hpss-get-physical-lock-status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1084
1084
        self.assertFinished(client)
1085
1085
 
1086
1086
 
 
1087
class TestBranchGetPhysicalLockStatus(RemoteBranchTestCase):
 
1088
 
 
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)
 
1104
 
 
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/',),
 
1113
            'success', ('no',))
 
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)
 
1120
 
 
1121
 
1087
1122
class TestBranchGetParent(RemoteBranchTestCase):
1088
1123
 
1089
1124
    def test_no_parent(self):
2732
2767
        self.assertEqual(False, result)
2733
2768
 
2734
2769
 
 
2770
class TestRepositoryPhysicalLockStatus(TestRemoteRepository):
 
2771
 
 
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()
 
2777
        self.assertEqual(
 
2778
            [('call', 'Repository.get_physical_lock_status',
 
2779
              ('qwack/', ))],
 
2780
            client._calls)
 
2781
        self.assertEqual(True, result)
 
2782
 
 
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()
 
2788
        self.assertEqual(
 
2789
            [('call', 'Repository.get_physical_lock_status',
 
2790
              ('qwack/', ))],
 
2791
            client._calls)
 
2792
        self.assertEqual(False, result)
 
2793
 
 
2794
 
2735
2795
class TestRepositoryIsShared(TestRemoteRepository):
2736
2796
 
2737
2797
    def test_is_shared(self):