12
12
STAGING_SERVICE_ROOT)
14
14
from bzrlib.plugins.pqm.lpland import (
15
get_bazaar_host, get_bugs_clause, get_reviewer_clause,
15
get_bugs_clause, get_reviewer_clause,
16
16
get_reviewer_handle, get_testfix_clause, get_qa_clause,
17
17
MissingReviewError, MissingBugsError, MissingBugsIncrementalError,
320
320
# If the merge proposal hasn't been approved by anyone, we cannot
321
321
# generate a valid clause.
322
322
self.assertRaises(MissingReviewError, self.get_reviewer_clause, {})
325
class TestGetBazaarHost(unittest.TestCase):
326
"""Tests for `get_bazaar_host`."""
328
def test_dev_service(self):
329
# The Bazaar host for the dev service is bazaar.launchpad.dev.
331
'bazaar.launchpad.dev', get_bazaar_host(DEV_SERVICE_ROOT))
333
def test_edge_service(self):
334
# The Bazaar host for the edge service is bazaar.launchpad.net, since
335
# there's no edge codehosting service.
337
'bazaar.launchpad.net', get_bazaar_host(EDGE_SERVICE_ROOT))
339
def test_production_service(self):
340
# The Bazaar host for the production service is bazaar.launchpad.net.
342
'bazaar.launchpad.net', get_bazaar_host(LPNET_SERVICE_ROOT))
344
def test_staging_service(self):
345
# The Bazaar host for the staging service is
346
# bazaar.staging.launchpad.net.
348
'bazaar.staging.launchpad.net',
349
get_bazaar_host(STAGING_SERVICE_ROOT))
351
def test_unrecognized_service(self):
352
# Any unrecognized URL will raise a ValueError.
354
ValueError, get_bazaar_host, 'https://api.lunchpad.net')