[merge] remove test_remote tests for deprecated methods

Martin Pool mbp at canonical.com
Tue Mar 17 09:52:44 GMT 2009


So in the course of removing code for things deprecated prior to 1.6,
I found I had to delete these two tests to make them pass.  But I'm
not sure if that's really the best thing to do, and whether it'll
cause trouble for old clients or in connecting to old servers.

I guess in general by removing deprecated code we will be breaking old
clients that depend on it.   Keeping compatibility is good but we also
want to be able to clean the codebase.

I don't have an immediate decision so I'll send this and see what you think...

-- 
Martin <http://launchpad.net/~mbp/>



=== modified file 'bzrlib/tests/test_remote.py'
--- bzrlib/tests/test_remote.py	2009-03-17 02:17:42 +0000
+++ bzrlib/tests/test_remote.py	2009-03-17 09:48:59 +0000
@@ -1559,55 +1559,6 @@
             client._calls)
         repo.unlock()

-    def test_get_parent_map_reconnects_if_unknown_method(self):
-        transport_path = 'quack'
-        repo, client = self.setup_fake_client_and_repository(transport_path)
-        client.add_unknown_method_response('Repository,get_parent_map')
-        client.add_success_response_with_body('', 'ok')
-        self.assertFalse(client._medium._is_remote_before((1, 2)))
-        rev_id = 'revision-id'
-        expected_deprecations = [
-            'bzrlib.remote.RemoteRepository.get_revision_graph was deprecated '
-            'in version 1.4.']
-        parents = self.callDeprecated(
-            expected_deprecations, repo.get_parent_map, [rev_id])
-        self.assertEqual(
-            [('call_with_body_bytes_expecting_body',
-              'Repository.get_parent_map', ('quack/', rev_id), '\n\n0'),
-             ('disconnect medium',),
-             ('call_expecting_body', 'Repository.get_revision_graph',
-              ('quack/', ''))],
-            client._calls)
-        # The medium is now marked as being connected to an older server
-        self.assertTrue(client._medium._is_remote_before((1, 2)))
-
-    def test_get_parent_map_fallback_parentless_node(self):
-        """get_parent_map falls back to get_revision_graph on old servers.  The
-        results from get_revision_graph are tweaked to match the get_parent_map
-        API.
-
-        Specifically, a {key: ()} result from get_revision_graph means "no
-        parents" for that key, which in get_parent_map results should be
-        represented as {key: ('null:',)}.
-
-        This is the test for https://bugs.launchpad.net/bzr/+bug/214894
-        """
-        rev_id = 'revision-id'
-        transport_path = 'quack'
-        repo, client = self.setup_fake_client_and_repository(transport_path)
-        client.add_success_response_with_body(rev_id, 'ok')
-        client._medium._remember_remote_is_before((1, 2))
-        expected_deprecations = [
-            'bzrlib.remote.RemoteRepository.get_revision_graph was deprecated '
-            'in version 1.4.']
-        parents = self.callDeprecated(
-            expected_deprecations, repo.get_parent_map, [rev_id])
-        self.assertEqual(
-            [('call_expecting_body', 'Repository.get_revision_graph',
-             ('quack/', ''))],
-            client._calls)
-        self.assertEqual({rev_id: ('null:',)}, parents)
-
     def test_get_parent_map_unexpected_response(self):
         repo, client = self.setup_fake_client_and_repository('path')
         client.add_success_response('something unexpected!')



More information about the bazaar mailing list