← Back to team overview

registry team mailing list archive

[Merge] lp:~jelmer/bzr-pqm/remove-bazaar-host into lp:bzr-pqm

 

Jelmer Vernooij has proposed merging lp:~jelmer/bzr-pqm/remove-bazaar-host into lp:bzr-pqm.

Requested reviews:
  Bzr-pqm-devel (bzr-pqm-devel)


This trivial branch removes the get_bazaar_host() function, which is no longer used.
-- 
https://code.launchpad.net/~jelmer/bzr-pqm/remove-bazaar-host/+merge/32651
Your team Bzr-pqm-devel is requested to review the proposed merge of lp:~jelmer/bzr-pqm/remove-bazaar-host into lp:bzr-pqm.
=== modified file 'lpland.py'
--- lpland.py	2010-08-03 21:58:03 +0000
+++ lpland.py	2010-08-14 01:27:40 +0000
@@ -367,21 +367,3 @@
         rc_clause = ''
     return '%s[r=%s][ui=%s]' % (
         rc_clause, _comma_separated_names(code_reviewers), ui_clause)
-
-
-def get_bazaar_host(api_root):
-    """Get the Bazaar service for the given API root."""
-    # XXX: JonathanLange 2009-09-24 bug=435803: This is only needed because
-    # Launchpad doesn't expose the push URL for branches.
-    if api_root == EDGE_SERVICE_ROOT:
-        return 'bazaar.launchpad.net'
-    elif api_root == DEV_SERVICE_ROOT:
-        return 'bazaar.launchpad.dev'
-    elif api_root == STAGING_SERVICE_ROOT:
-        return 'bazaar.staging.launchpad.net'
-    elif api_root == LPNET_SERVICE_ROOT:
-        return 'bazaar.launchpad.net'
-    else:
-        raise ValueError(
-            'Cannot determine Bazaar host. "%s" not a recognized Launchpad '
-            'API root.' % (api_root,))

=== modified file 'tests/test_lpland.py'
--- tests/test_lpland.py	2010-08-06 16:52:30 +0000
+++ tests/test_lpland.py	2010-08-14 01:27:40 +0000
@@ -12,7 +12,7 @@
     STAGING_SERVICE_ROOT)
 
 from bzrlib.plugins.pqm.lpland import (
-    get_bazaar_host, get_bugs_clause, get_reviewer_clause,
+    get_bugs_clause, get_reviewer_clause,
     get_reviewer_handle, get_testfix_clause, get_qa_clause,
     MissingReviewError, MissingBugsError, MissingBugsIncrementalError, 
     MergeProposal)
@@ -320,35 +320,3 @@
         # If the merge proposal hasn't been approved by anyone, we cannot
         # generate a valid clause.
         self.assertRaises(MissingReviewError, self.get_reviewer_clause, {})
-
-
-class TestGetBazaarHost(unittest.TestCase):
-    """Tests for `get_bazaar_host`."""
-
-    def test_dev_service(self):
-        # The Bazaar host for the dev service is bazaar.launchpad.dev.
-        self.assertEqual(
-            'bazaar.launchpad.dev', get_bazaar_host(DEV_SERVICE_ROOT))
-
-    def test_edge_service(self):
-        # The Bazaar host for the edge service is bazaar.launchpad.net, since
-        # there's no edge codehosting service.
-        self.assertEqual(
-            'bazaar.launchpad.net', get_bazaar_host(EDGE_SERVICE_ROOT))
-
-    def test_production_service(self):
-        # The Bazaar host for the production service is bazaar.launchpad.net.
-        self.assertEqual(
-            'bazaar.launchpad.net', get_bazaar_host(LPNET_SERVICE_ROOT))
-
-    def test_staging_service(self):
-        # The Bazaar host for the staging service is
-        # bazaar.staging.launchpad.net.
-        self.assertEqual(
-            'bazaar.staging.launchpad.net',
-            get_bazaar_host(STAGING_SERVICE_ROOT))
-
-    def test_unrecognized_service(self):
-        # Any unrecognized URL will raise a ValueError.
-        self.assertRaises(
-            ValueError, get_bazaar_host, 'https://api.lunchpad.net')


Follow ups