l.c.p.t.t.TestBranchPuller(PullerBranchTestCase, LoomTestMixin) : class documentation

Part of lp.codehosting.puller.tests.test_acceptance View In Hierarchy

Integration tests for the branch puller.

These tests actually run the supermirror-pull.py script. Instead of checking specific behaviour, these tests help ensure that all of the components in the branch puller system work together sanely.

Method setUp Undocumented
Method assertMirrored Assert that 'db_branch' was mirrored succesfully.
Method assertRanSuccessfully Assert that the command ran successfully.
Method runSubprocess Run the given command in a subprocess.
Method runPuller Run the puller script for the given branch type.
Method getLPServerForUser Construct a LaunchpadServer that serves branches as seen by user.
Method openBranchAsUser Open the branch as 'user' would see it as a client of codehosting.
Method setUpMirroredBranch Make a tree in the cwd and serve it over HTTP, returning the URL.
Method test_mirror_mirrored_branch Undocumented
Method test_mirror_mirrored_loom_branch Undocumented
Method test_format_change Undocumented
Method test_stack_mirrored_branch Undocumented
Method test_stack_mirrored_branch_onto_private Undocumented
Method test_mirror_imported_branch Undocumented
Method test_mirror_empty Undocumented
Method test_type_filtering Undocumented
Method test_records_script_activity Undocumented
Method _makeDefaultStackedOnBranch Make a default stacked-on branch.

Inherited from PullerBranchTestCase:

Method makeCleanDirectory Guarantee an empty branch upload area.
Method serveOverHTTP Serve the current directory over HTTP, returning the server URL.

Inherited from TestCaseWithFactory (via PullerBranchTestCase):

Method getUserBrowser Return a Browser logged in as a fresh user, maybe opened at url.
Method getNonRedirectingBrowser Undocumented
Method createBranchAtURL Create a branch at the supplied URL.
Method create_branch_and_tree Create a database branch, bzr branch and bzr checkout.
Method createBzrBranch Create a bzr branch for a database branch.
Static Method getBranchPath Return the path of the branch in the mirrored area.
Method useTempBzrHome Undocumented
Method useBzrBranches Prepare for using bzr branches.

Inherited from TestCase (via PullerBranchTestCase, TestCaseWithFactory):

Method becomeDbUser Commit, then log into the database as dbuser.
Method __str__ The string representation of a test is its id.
Method useContext Use the supplied context in this test.
Method makeTemporaryDirectory Create a temporary directory, and return its path.
Method installKarmaRecorder Set up and return a KarmaRecorder.
Method assertProvides Assert 'obj' correctly provides 'interface'.
Method assertNotifies Assert that a callable performs a given notification.
Method assertNoNotification Assert that no notifications are generated by the callable.
Method assertSqlAttributeEqualsDate Fail unless the value of the attribute is equal to the date.
Method assertTextMatchesExpressionIgnoreWhitespace Undocumented
Method assertIsInstance Assert that an instance is an instance of assert_class.
Method assertIsNot Assert that expected is not the same object as observed.
Method assertContentEqual Assert that 'iter1' has the same content as 'iter2'.
Method assertRaisesWithContent Check if the given exception is raised with given content.
Method assertBetween Assert that 'variable' is strictly between two boundaries.
Method assertVectorEqual Apply assertEqual to all given pairs in one go.
Method expectedLog Expect a log to be written that matches the regex.
Method pushConfig Push some key-value pairs into a section of the config.
Method attachOopses Undocumented
Method attachLibrarianLog Include the logChunks from fixture in the test details.
Method assertStatementCount Assert that the expected number of SQL statements occurred.
Method useTempDir Use a temporary directory for this test.
Method assertEmailHeadersEqual Assert that two email headers are equal.
Method assertStartsWith Undocumented
Method assertEndsWith Asserts that s ends with suffix.
Method checkPermissions Check if the used_permissions match expected_permissions.
Method assertEmailQueueLength Pop the email queue, assert its length, and return it.
Method _unfoldEmailHeader Unfold a multiline email header.

Inherited from LoomTestMixin (via PullerBranchTestCase):

Method loomify Undocumented
Method makeLoomBranchAndTree Make a looms-enabled branch and working tree.

Inherited from LoomTestMixin:

Method loomify Undocumented
Method makeLoomBranchAndTree Make a looms-enabled branch and working tree.
def setUp(self):
def assertMirrored(self, db_branch, source_branch):
Assert that 'db_branch' was mirrored succesfully.

This method checks that the fields on db_branch show that the branch has been mirrored successfully, and checks that the Bazaar source and destination branches (from the puller's point of view) are consistent with this and each other.

Parametersdb_branchThe IBranch representing the branch that was mirrored.
source_branchThe source branch. If not passed, look for the branch in the hosted area.
accessing_userOpen the mirrored branch as this user. If not supplied create a fresh user for this -- but this won't work for a private branch.
def assertRanSuccessfully(self, command, retcode, stdout, stderr):
Assert that the command ran successfully.

'Successfully' means that it's return code was 0 and it printed nothing to stdout or stderr.

def runSubprocess(self, command):
Run the given command in a subprocess.
ParameterscommandA command and arguments given as a list.
Returnsretcode, stdout, stderr
def runPuller(self, *args):
Run the puller script for the given branch type.
Parametersbranch_typeOne of 'upload', 'mirror' or 'import'
ReturnsTuple of command, retcode, output, error. 'command' is the executed command as a list, retcode is the process's return code, output and error are strings contain the output of the process to stdout and stderr respectively.
def getLPServerForUser(self, user):
Construct a LaunchpadServer that serves branches as seen by user.

Given 'db_branch', a database branch object 'db_branch', and 'lp_server', the server returned by this method, 'Branch.open(lp_server.get_url() + db_branch.unique_name)' will open the branch as 'user' sees it as a client of the code hosting service, i.e. it will be opened from the hosting area if the branch type HOSTED and the user has launchpad.Edit on the branch and opened from the mirrored area otherwise.

def openBranchAsUser(self, db_branch, user):
Open the branch as 'user' would see it as a client of codehosting.
def setUpMirroredBranch(self, db_branch, format=None):
Make a tree in the cwd and serve it over HTTP, returning the URL.
def test_mirror_mirrored_branch(self):
def test_mirror_mirrored_loom_branch(self):
def test_format_change(self):
def _makeDefaultStackedOnBranch(self, private=False):
Make a default stacked-on branch.

This creates a database product branch, makes it the default stacked-on branch for its product and creates a Bazaar branch for it.

ParametersprivateWhether the created branch should be private or not (defaults to not).
def test_stack_mirrored_branch(self):
def test_stack_mirrored_branch_onto_private(self):
def test_mirror_imported_branch(self):
def test_mirror_empty(self):
def test_type_filtering(self):
def test_records_script_activity(self):
API Documentation for Launchpad, generated by pydoctor at 2020-11-28 00:00:02.