c.l.b.t.t.TestBranchPopupWidget(unittest.TestCase) : class documentation

Part of canonical.launchpad.browser.tests.test_widgets View In Hierarchy

Tests for the branch popup widget.
Method assertIs Assert first is second.
Method installLaunchBag Undocumented
Method makeBranchPopup Undocumented
Method makeField Undocumented
Method makeRequest Undocumented
Method setUp Undocumented
Method tearDown Undocumented
Method test_getProduct getProduct() returns the product in the LaunchBag.
Method test_getPerson getPerson() returns the logged-in user.
Method test_getBranchNameFromURL getBranchNameFromURL() gets a branch name from a url.
Method test_makeBranchFromURL makeBranchFromURL(url) creates a mirrored branch at url.
Method test_makeBranch_used Undocumented
Method test_makeBranchRequestsMirror makeBranch requests a mirror on the branch it creates.
Method test_makeBranchNoProduct makeBranchFromURL(url) returns None if there's no product.
Method test_makeBranchTrailingSlash makeBranch creates a mirrored branch even if the URL ends with /.
Method test_toFieldValueFallsBackToMakingBranch _toFieldValue falls back to making a branch if it's given a URL.
Method test_toFieldValueFetchesTheExistingBranch _toFieldValue returns the existing branch that has that URL.
Method test_toFieldValueNonURL When the input isn't a URL, fall back to the original error.
Method test_toFieldValueNoProduct When there's no product, fall back to the original error.
Method test_toFieldBadURL When the input is a bad URL, fall back to the original error.
Method test_branchInRestrictedProduct Undocumented
def assertIs(self, first, second):
Assert first is second.
def installLaunchBag(self, user=None, product=None):
Undocumented
def makeBranchPopup(self, vocabulary=None):
Undocumented
def makeField(self, context, vocabulary):
Undocumented
def makeRequest(self):
Undocumented
def setUp(self):
Undocumented
def tearDown(self):
Undocumented
def test_getProduct(self):
getProduct() returns the product in the LaunchBag.
def test_getPerson(self):
getPerson() returns the logged-in user.
def test_getBranchNameFromURL(self):
getBranchNameFromURL() gets a branch name from a url.

In general, the name is the last path segment of the URL.

def test_makeBranchFromURL(self):
makeBranchFromURL(url) creates a mirrored branch at url.

The owner and registrant are the currently logged-in user, as given by getPerson(), and the product is the product in the LaunchBag.

def test_makeBranch_used(self):
Undocumented
def test_makeBranchRequestsMirror(self):
makeBranch requests a mirror on the branch it creates.
def test_makeBranchNoProduct(self):
makeBranchFromURL(url) returns None if there's no product.

Not all contexts for branch registration have products. In particular, a bug can be on a source package. When we link a branch to that bug, there's no clear product to choose, so we don't choose any.

def test_makeBranchTrailingSlash(self):
makeBranch creates a mirrored branch even if the URL ends with /.
def test_toFieldValueFallsBackToMakingBranch(self):
_toFieldValue falls back to making a branch if it's given a URL.
def test_toFieldValueFetchesTheExistingBranch(self):
_toFieldValue returns the existing branch that has that URL.
def test_toFieldValueNonURL(self):
When the input isn't a URL, fall back to the original error.
def test_toFieldValueNoProduct(self):
When there's no product, fall back to the original error.
def test_toFieldBadURL(self):
When the input is a bad URL, fall back to the original error.

There are many valid URLs that are inappropriate for a mirrored branch. We don't want to register a mirrored branch when someone enters such a URL.

def test_branchInRestrictedProduct(self):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.