~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

Merge fix for bug #388269 into trunk, resolve conflicts and add release notes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2274
2274
        self.assertEqual({}, repo.get_parent_map(['non-existant']))
2275
2275
        self.assertLength(0, self.hpss_calls)
2276
2276
 
 
2277
    def test_exposes_get_cached_parent_map(self):
 
2278
        """RemoteRepository exposes get_cached_parent_map from
 
2279
        _unstacked_provider
 
2280
        """
 
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))
 
2285
 
 
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')
 
2289
        repo.lock_read()
 
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]))
 
2296
        self.assertEqual(
 
2297
            [('call_with_body_bytes_expecting_body',
 
2298
              'Repository.get_parent_map', ('quack/', 'include-missing:', r2),
 
2299
              '\n\n0')],
 
2300
            client._calls)
 
2301
        repo.unlock()
 
2302
 
2277
2303
 
2278
2304
class TestGetParentMapAllowsNew(tests.TestCaseWithTransport):
2279
2305