2274
2274
self.assertEqual({}, repo.get_parent_map(['non-existant']))
2275
2275
self.assertLength(0, self.hpss_calls)
2277
def test_exposes_get_cached_parent_map(self):
2278
"""RemoteRepository exposes get_cached_parent_map from
2281
r1 = u'\u0e33'.encode('utf8')
2282
r2 = u'\u0dab'.encode('utf8')
2283
lines = [' '.join([r2, r1]), r1]
2284
encoded_body = bz2.compress('\n'.join(lines))
2286
transport_path = 'quack'
2287
repo, client = self.setup_fake_client_and_repository(transport_path)
2288
client.add_success_response_with_body(encoded_body, 'ok')
2290
# get_cached_parent_map should *not* trigger an RPC
2291
self.assertEqual({}, repo.get_cached_parent_map([r1]))
2292
self.assertEqual([], client._calls)
2293
self.assertEqual({r2: (r1,)}, repo.get_parent_map([r2]))
2294
self.assertEqual({r1: (NULL_REVISION,)},
2295
repo.get_cached_parent_map([r1]))
2297
[('call_with_body_bytes_expecting_body',
2298
'Repository.get_parent_map', ('quack/', 'include-missing:', r2),
2278
2304
class TestGetParentMapAllowsNew(tests.TestCaseWithTransport):