当前位置: 首页>>代码示例>>Python>>正文


Python TestCaseWithFactory.setUp方法代码示例

本文整理汇总了Python中lp.testing.TestCaseWithFactory.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python TestCaseWithFactory.setUp方法的具体用法?Python TestCaseWithFactory.setUp怎么用?Python TestCaseWithFactory.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lp.testing.TestCaseWithFactory的用法示例。


在下文中一共展示了TestCaseWithFactory.setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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)
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_logintoken.py

示例2: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
    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)
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:27,代码来源:test_sourcepackage.py

示例3: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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")
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_revision.py

示例4: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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())
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_specificationtarget.py

示例5: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_manager.py

示例6: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:9,代码来源:test_productserieslanguage.py

示例7: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_packaging.py

示例8: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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')
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:9,代码来源:test_person_webservice.py

示例9: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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()
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:9,代码来源:test_processaccepted.py

示例10: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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())
开发者ID:abramhindle,项目名称:UnnaturalCodeFork,代码行数:10,代码来源:test_launchpadroot.py

示例11: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:10,代码来源:test_codeimport.py

示例12: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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 = []
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:11,代码来源:test_mergedetection.py

示例13: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:11,代码来源:test_dkim.py

示例14: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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)
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:11,代码来源:test_sourceslistentries.py

示例15: setUp

# 需要导入模块: from lp.testing import TestCaseWithFactory [as 别名]
# 或者: from lp.testing.TestCaseWithFactory import setUp [as 别名]
 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()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:11,代码来源:test_codereviewcomment.py


注:本文中的lp.testing.TestCaseWithFactory.setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。