本文整理汇总了Python中lp.testing.TestCaseWithFactory类的典型用法代码示例。如果您正苦于以下问题:Python TestCaseWithFactory类的具体用法?Python TestCaseWithFactory怎么用?Python TestCaseWithFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestCaseWithFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.claimer = self.factory.makePerson(name='claimer')
self.claimee_email = '[email protected]'
self.claimee = self.factory.makePerson(
name='claimee', email=self.claimee_email,
email_address_status=EmailAddressStatus.NEW)
示例2: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.owner = self.factory.makePerson()
self.product = self.factory.makeProduct(
name='bonkers', displayname='Bonkers', owner=self.owner)
self.obsolete_productseries = self.factory.makeProductSeries(
name='obsolete', product=self.product)
with person_logged_in(self.product.owner):
self.obsolete_productseries.status = SeriesStatus.OBSOLETE
self.dev_productseries = self.factory.makeProductSeries(
name='current', product=self.product)
with person_logged_in(self.product.owner):
self.dev_productseries.status = SeriesStatus.DEVELOPMENT
self.distribution = self.factory.makeDistribution(
name='youbuntu', displayname='Youbuntu', owner=self.owner)
self.distroseries = self.factory.makeDistroSeries(
name='busy', distribution=self.distribution)
self.sourcepackagename = self.factory.makeSourcePackageName(
name='bonkers')
self.package = self.factory.makeSourcePackage(
sourcepackagename=self.sourcepackagename,
distroseries=self.distroseries)
示例3: setUp
def setUp(self):
# Use an administrator to set branch privacy easily.
TestCaseWithFactory.setUp(self, "[email protected]")
# Exclude sample data from the test results.
IStore(RevisionCache).execute(
"UPDATE Revision SET karma_allocated = TRUE "
"WHERE karma_allocated IS FALSE")
示例4: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.user = self.factory.makePerson(name="macadamia")
login_person(self.user)
# Use a FakeLogger fixture to prevent Memcached warnings to be
# printed to stdout while browsing pages.
self.useFixture(FakeLogger())
示例5: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.builder = self.factory.makeBuilder()
self.build = self.factory.makeSourcePackageRecipeBuild()
self.buildqueue = self.build.queueBuild()
self.buildqueue.markAsBuilding(self.builder)
self.slave = OkSlave()
示例6: setUp
def setUp(self):
# Create a productseries that uses translations.
TestCaseWithFactory.setUp(self)
product = self.factory.makeProduct(
translations_usage=ServiceUsage.LAUNCHPAD)
self.productseries = self.factory.makeProductSeries(
product=product)
示例7: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.packaging_util = getUtility(IPackagingUtil)
self.sourcepackagename = self.factory.makeSourcePackageName('sparkle')
self.distroseries = self.factory.makeDistroSeries(name='dazzle')
self.productseries = self.factory.makeProductSeries(name='glitter')
self.owner = self.productseries.product.owner
示例8: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
login('[email protected] ')
self.person = self.factory.makePerson(
name='test-person', displayname='Test Person')
self.webservice = LaunchpadWebServiceCaller(
'launchpad-library', 'salgado-change-anything')
示例9: setUp
def setUp(self):
"""Create the Soyuz test publisher."""
TestCaseWithFactory.setUp(self)
self.stp = SoyuzTestPublisher()
self.stp.prepareBreezyAutotest()
self.test_package_name = u"accept-test"
self.distro = self.factory.makeDistribution()
示例10: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.root = getUtility(ILaunchpadRoot)
self.admin = getUtility(IPersonSet).getByEmail(
'[email protected]')
# Use a FakeLogger fixture to prevent Memcached warnings to be
# printed to stdout while browsing pages.
self.useFixture(FakeLogger())
示例11: setUp
def setUp(self):
# Log in a VCS Imports member.
TestCaseWithFactory.setUp(self, '[email protected]')
self.import_operator = getUtility(IPersonSet).getByEmail(
'[email protected]')
# Remove existing jobs.
for job in CodeImportJob.select():
job.destroySelf()
示例12: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.product = self.factory.makeProduct()
self.db_branch = self.factory.makeProductBranch(product=self.product)
# Replace the built-in merge_detected with our test stub.
self._original_merge_detected = mergedetection.merge_detected
mergedetection.merge_detected = self.mergeDetected
# Reset the recorded branches.
self.merges = []
示例13: setUp
def setUp(self):
# Login with admin roles as we aren't testing access here.
TestCaseWithFactory.setUp(self, '[email protected]')
self._log_output = StringIO()
handler = logging.StreamHandler(self._log_output)
logger = logging.getLogger('mail-authenticate-dkim')
logger.addHandler(handler)
self.addCleanup(lambda: logger.removeHandler(handler))
self.monkeypatch_dns()
示例14: setUp
def setUp(self):
TestCaseWithFactory.setUp(self)
self.distribution = self.factory.makeDistribution(name='ibuntu')
self.series = [
self.factory.makeDistroSeries(name="feasty", version='9.04'),
]
self.entries = SourcesListEntries(
self.distribution, 'http://example.com/my/archive',
self.series)
示例15: setUp
def setUp(self):
TestCaseWithFactory.setUp(self, '[email protected]')
source = self.factory.makeProductBranch(title='source-branch')
target = self.factory.makeProductBranch(
product=source.product, title='target-branch')
self.bmp = source.addLandingTarget(source.owner, target)
self.submitter = self.factory.makePerson()
self.reviewer = self.factory.makePerson()
self.bmp2 = self.factory.makeBranchMergeProposal()