~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/tests/test_branch.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-10 15:16:40 UTC
  • mfrom: (13637.3.6 safe-open-reconcile)
  • Revision ID: launchpad@pqm.canonical.com-20110810151640-jv0uzsxpns5dhy8z
[r=stevenk][bug=820453] Make lp.codehosting.bzrutils.safe_open a
        trivial wrapper around SafeBranchOpener rather than duplicating
        the code for safely opening a branch in two places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
from lp.code.model.codereviewcomment import CodeReviewComment
109
109
from lp.code.model.revision import Revision
110
110
from lp.code.tests.helpers import add_revision_to_branch
111
 
from lp.codehosting.bzrutils import UnsafeUrlSeen
 
111
from lp.codehosting.safe_open import BadUrl
112
112
from lp.registry.interfaces.pocket import PackagePublishingPocket
113
113
from lp.registry.model.sourcepackage import SourcePackage
114
114
from lp.services.osutils import override_environ
2686
2686
 
2687
2687
 
2688
2688
class TestGetBzrBranch(TestCaseWithFactory):
2689
 
    """Tests for `IBranch.safe_open`."""
 
2689
    """Tests for `IBranch.getBzrBranch`."""
2690
2690
 
2691
2691
    layer = DatabaseFunctionalLayer
2692
2692
 
2722
2722
        branch = BzrDir.create_branch_convenience('local')
2723
2723
        db_stacked, stacked_tree = self.create_branch_and_tree()
2724
2724
        stacked_tree.branch.set_stacked_on_url(branch.base)
2725
 
        self.assertRaises(UnsafeUrlSeen, db_stacked.getBzrBranch)
 
2725
        self.assertRaises(BadUrl, db_stacked.getBzrBranch)
2726
2726
 
2727
2727
 
2728
2728
class TestMergeQueue(TestCaseWithFactory):