129
130
[('call', 'Branch.last_revision_info', ('///kwaak/',))],
131
132
self.assertEqual((2, u'\xc8'), result)
135
class TestRepositoryIsShared(tests.TestCase):
137
def setup_fake_client_and_repository(self, responses, transport_path):
138
"""Create the fake client and repository for testing with."""
139
client = FakeClient(responses)
140
transport = MemoryTransport()
141
transport.mkdir(transport_path)
142
transport = transport.clone(transport_path)
143
# we do not want bzrdir to make any remote calls
144
bzrdir = RemoteBzrDir(transport, _client=False)
145
repo = RemoteRepository(bzrdir, None, _client=client)
148
def test_is_shared(self):
149
# ('yes', ) for Repository.is_shared -> 'True'.
150
responses = [('yes', )]
151
transport_path = 'quack'
152
repo, client = self.setup_fake_client_and_repository(
153
responses, transport_path)
154
result = repo.is_shared()
156
[('call', 'Repository.is_shared', ('///quack/',))],
158
self.assertEqual(True, result)
160
def test_is_not_shared(self):
161
# ('no', ) for Repository.is_shared -> 'False'.
162
responses = [('no', )]
163
transport_path = 'qwack'
164
repo, client = self.setup_fake_client_and_repository(
165
responses, transport_path)
166
result = repo.is_shared()
168
[('call', 'Repository.is_shared', ('///qwack/',))],
170
self.assertEqual(False, result)