l.a.t.test_dominator : module documentation

Part of lp.archivepublisher.tests

Tests for domination.py.
Class TestDominator Test Dominator class.
Class TestDomination Test overall domination procedure.
Class TestDominationOfObsoletedSeries Replay domination tests upon a OBSOLETED distroseries.
Function remove_security_proxies Return list of proxied_objects, without their proxies.
Function make_spphs_for_versions Create publication records for each of versions.
Function make_bpphs_for_versions Create publication records for each of versions.
Function list_source_versions Extract the versions from spphs as a list, in the same order.
Function alter_creation_dates Set datecreated on each of spphs according to ages.
Class TestGeneralizedPublication Test publication generalization helpers.
Function jumble Jumble the elements of ordered_list into a weird order.
Class TestDominatorMethods No class docstring; 1/39 methods documented
Function make_publications_arch_specific Set the architecturespecific attribute for given SPPHs.
Class TestLivenessFunctions Tests for the functions that say which versions are live.
Class TestDominationHelpers Test lightweight helpers for the Dominator.
Class TestArchSpecificPublicationsCache Tests for ArchSpecificPublicationsCache.
def remove_security_proxies(proxied_objects):
Return list of proxied_objects, without their proxies.

The dominator runs only in scripts, where security proxies don't get in the way. To test realistically for this environment, strip the proxies wherever necessary and do as you will.

def make_spphs_for_versions(factory, versions):
Create publication records for each of versions.

All these publications will be in the same source package, archive, distroseries, and pocket. They will all be in Published status.

The records are created in the same order in which they are specified. Make the order irregular to prove that version ordering is not a coincidence of object creation order etc.

Versions may also be identical; each publication record will still have its own package release.

def make_bpphs_for_versions(factory, versions):
Create publication records for each of versions.

All these publications will be in the same binary package, source package, archive, distroarchseries, and pocket. They will all be in Published status.

def list_source_versions(spphs):
Extract the versions from spphs as a list, in the same order.
def alter_creation_dates(spphs, ages):
Set datecreated on each of spphs according to ages.
ParametersspphsIterable of SourcePackagePublishingHistory. Their respective creation dates will be offset by the respective ages found in ages (with the two being matched up in the same order).
agesIterable of ages. Must provide the same number of items as spphs. Ages are timedelta objects that will be subtracted from the creation dates on the respective records in spph.
def jumble(ordered_list):
Jumble the elements of ordered_list into a weird order.

Ordering is very important in domination. We jumble some of our lists to insure against "lucky coincidences" that might give our tests the right answers for the wrong reasons.

def make_publications_arch_specific(pubs, arch_specific=True):
Set the architecturespecific attribute for given SPPHs.
ParameterspubsAn iterable of BinaryPackagePublishingHistory.
arch_specificWhether the binary package releases published by pubs are to be architecture-specific. If not, they will be treated as being for the "all" architecture.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.