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


Python test_publishing.SoyuzTestPublisher类代码示例

本文整理汇总了Python中lp.soyuz.tests.test_publishing.SoyuzTestPublisher的典型用法代码示例。如果您正苦于以下问题:Python SoyuzTestPublisher类的具体用法?Python SoyuzTestPublisher怎么用?Python SoyuzTestPublisher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TestBuildJobBase

class TestBuildJobBase(TestCaseWithFactory):
    """Setup the test publisher and some builders."""

    layer = LaunchpadZopelessLayer

    def setUp(self):
        super(TestBuildJobBase, self).setUp()
        self.publisher = SoyuzTestPublisher()
        self.publisher.prepareBreezyAutotest()

        self.i8 = self.factory.makeBuilder(name='i386-n-8', virtualized=False)
        self.i9 = self.factory.makeBuilder(name='i386-n-9', virtualized=False)

        processor = getUtility(IProcessorSet).getByName('hppa')
        self.h6 = self.factory.makeBuilder(
            name='hppa-n-6', processor=processor, virtualized=False)
        self.h7 = self.factory.makeBuilder(
            name='hppa-n-7', processor=processor, virtualized=False)

        self.builders = dict()
        # x86 native
        self.builders[(1, False)] = [self.i8, self.i9]

        # hppa native
        self.builders[(3, True)] = [self.h6, self.h7]

        # Ensure all builders are operational.
        for builders in self.builders.values():
            for builder in builders:
                builder.builderok = True
                builder.manual = False

        # Disable the sample data builders.
        getUtility(IBuilderSet)['bob'].builderok = False
        getUtility(IBuilderSet)['frog'].builderok = False
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:35,代码来源:test_buildpackagejob.py

示例2: test_copy_archive_without_leak

 def test_copy_archive_without_leak(self):
     # If source publications are copied to a .COPY archive, they don't
     # "leak" into SourcePackage.getBuildRecords().
     admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
     # Set up a distroseries and related bits, so we can create builds.
     source_name = self.factory.getUniqueString()
     spn = self.factory.makeSourcePackageName(name=source_name)
     processor = self.factory.makeProcessor()
     distroseries = self.factory.makeDistroSeries()
     das = self.factory.makeDistroArchSeries(
         distroseries=distroseries, processor=processor,
         supports_virtualized=True)
     with person_logged_in(admin):
         publisher = SoyuzTestPublisher()
         publisher.prepareBreezyAutotest()
         publisher.addFakeChroots(distroseries=distroseries)
         distroseries.nominatedarchindep = das
         self.factory.makeBuilder(processor=processor)
     spph = self.factory.makeSourcePackagePublishingHistory(
         sourcepackagename=spn, distroseries=distroseries)
     spph.createMissingBuilds()
     # Create a copy archive.
     copy = self.factory.makeArchive(
         purpose=ArchivePurpose.COPY,
         distribution=distroseries.distribution)
     # And copy the publication into it.
     copy_spph = spph.copyTo(
         distroseries, PackagePublishingPocket.RELEASE, copy)
     [copy_build] = copy_spph.createMissingBuilds()
     builds = copy.getBuildRecords()
     self.assertEquals([copy_build], list(builds))
     source = SourcePackage(spn, spph.distroseries)
     # SourcePackage.getBuildRecords() doesn't have two build records.
     builds = source.getBuildRecords().count()
     self.assertEquals(1, builds)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:35,代码来源:test_hasbuildrecords.py

示例3: test_dispatchBuildToSlave

    def test_dispatchBuildToSlave(self):
        # Ensure dispatchBuildToSlave will make the right calls to the slave
        job = self.makeJob()
        test_publisher = SoyuzTestPublisher()
        test_publisher.addFakeChroots(job.build.distroseries)
        slave = OkSlave()
        builder = MockBuilder("bob-de-bouwer")
        builder.processor = getUtility(IProcessorSet).getByName("386")
        job.setBuilder(builder, slave)
        logger = BufferLogger()
        d = defer.maybeDeferred(job.dispatchBuildToSlave, "someid", logger)

        def check_dispatch(ignored):
            self.assertThat(
                logger.getLogBuffer(),
                StartsWith(
                    dedent(
                        """\
                  INFO Sending chroot file for recipe build to bob-de-bouwer
                  INFO Initiating build 1-someid on http://fake:0000
                  """
                    )
                ),
            )
            self.assertEquals(["ensurepresent", "build"], [call[0] for call in slave.call_log])
            build_args = slave.call_log[1][1:]
            self.assertEquals(build_args[0], job.getBuildCookie())
            self.assertEquals(build_args[1], "sourcepackagerecipe")
            self.assertEquals(build_args[3], [])
            distroarchseries = job.build.distroseries.architectures[0]
            self.assertEqual(build_args[4], job._extraBuildArgs(distroarchseries))

        return d.addCallback(check_dispatch)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:33,代码来源:test_recipebuilder.py

示例4: create_child

def create_child(factory):
    processor = factory.makeProcessor()
    parent = factory.makeDistroSeries()
    parent_das = factory.makeDistroArchSeries(distroseries=parent, processor=processor)
    lf = factory.makeLibraryFileAlias()
    # Since the LFA needs to be in the librarian, commit.
    transaction.commit()
    parent_das.addOrUpdateChroot(lf)
    with celebrity_logged_in("admin"):
        parent_das.supports_virtualized = True
        parent.nominatedarchindep = parent_das
        publisher = SoyuzTestPublisher()
        publisher.prepareBreezyAutotest()
        packages = {"udev": "0.1-1", "libc6": "2.8-1"}
        for package in packages.keys():
            publisher.getPubBinaries(
                distroseries=parent,
                binaryname=package,
                version=packages[package],
                status=PackagePublishingStatus.PUBLISHED,
            )
        test1 = getUtility(IPackagesetSet).new(u"test1", u"test 1 packageset", parent.owner, distroseries=parent)
        test1_packageset_id = str(test1.id)
        test1.addSources("udev")
    parent.updatePackageCount()
    child = factory.makeDistroSeries()
    getUtility(ISourcePackageFormatSelectionSet).add(child, SourcePackageFormat.FORMAT_1_0)
    # Make sure everything hits the database, switching db users aborts.
    transaction.commit()
    return parent, child, test1_packageset_id
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:30,代码来源:test_initializedistroseriesjob.py

示例5: addSummaryToDifference

    def addSummaryToDifference(self, distro_series_difference):
        """Helper that adds binaries with summary info to the source pubs."""
        # Avoid circular import.
        from lp.soyuz.tests.test_publishing import SoyuzTestPublisher
        distro_series = distro_series_difference.derived_series
        parent_series = distro_series_difference.parent_series
        source_package_name_str = (
            distro_series_difference.source_package_name.name)
        stp = SoyuzTestPublisher()

        if distro_series_difference.difference_type == (
            DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES):
            source_pub = distro_series_difference.parent_source_pub
        else:
            source_pub = distro_series_difference.source_pub

        stp.makeSourcePackageSummaryData(source_pub)
        stp.updateDistroSeriesPackageCache(source_pub.distroseries)

        # updateDistroSeriesPackageCache reconnects the db, so the
        # objects need to be reloaded.
        dsd_source = getUtility(IDistroSeriesDifferenceSource)
        ds_diff = dsd_source.getByDistroSeriesNameAndParentSeries(
            distro_series, source_package_name_str, parent_series)
        return ds_diff
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:25,代码来源:test_distroseriesdifference_views.py

示例6: TestDistributionHasBuildRecords

class TestDistributionHasBuildRecords(TestCaseWithFactory):
    """Populate a distroseries with builds"""

    layer = LaunchpadZopelessLayer

    def setUp(self):
        super(TestDistributionHasBuildRecords, self).setUp()
        self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
        # Create the machinery we need to create builds, such as
        # DistroArchSeries and builders.
        self.processor_one = self.factory.makeProcessor()
        self.processor_two = self.factory.makeProcessor()
        self.distroseries = self.factory.makeDistroSeries()
        self.distribution = self.distroseries.distribution
        self.das_one = self.factory.makeDistroArchSeries(
            distroseries=self.distroseries, processor=self.processor_one,
            supports_virtualized=True)
        self.das_two = self.factory.makeDistroArchSeries(
            distroseries=self.distroseries, processor=self.processor_two,
            supports_virtualized=True)
        self.archive = self.factory.makeArchive(
            distribution=self.distroseries.distribution,
            purpose=ArchivePurpose.PRIMARY)
        self.arch_ids = [arch.id for arch in self.distroseries.architectures]
        with person_logged_in(self.admin):
            self.publisher = SoyuzTestPublisher()
            self.publisher.prepareBreezyAutotest()
            self.distroseries.nominatedarchindep = self.das_one
            self.publisher.addFakeChroots(distroseries=self.distroseries)
            self.builder_one = self.factory.makeBuilder(
                processor=self.processor_one)
            self.builder_two = self.factory.makeBuilder(
                processor=self.processor_two)
        self.builds = []
        self.createBuilds()

    def createBuilds(self):
        for i in range(5):
            # Create some test builds.
            spph = self.publisher.getPubSource(
                sourcename=self.factory.getUniqueString(),
                version="%s.%s" % (self.factory.getUniqueInteger(), i),
                distroseries=self.distroseries, architecturehintlist='any')
            builds = spph.createMissingBuilds()
            for b in builds:
                b.updateStatus(BuildStatus.BUILDING)
                if i == 4:
                    b.updateStatus(BuildStatus.FAILEDTOBUILD)
                else:
                    b.updateStatus(BuildStatus.FULLYBUILT)
                b.buildqueue_record.destroySelf()
            self.builds += builds

    def test_get_build_records(self):
        # A Distribution also implements IHasBuildRecords.
        builds = self.distribution.getBuildRecords().count()
        self.assertEquals(10, builds)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:57,代码来源:test_hasbuildrecords.py

示例7: _makePublishedSourcePackage

    def _makePublishedSourcePackage(self):
        test_publisher = SoyuzTestPublisher()
        test_data = test_publisher.makeSourcePackageSummaryData()
        source_package_name = test_data["source_package"].sourcepackagename.name
        distroseries_id = test_data["distroseries"].id
        test_publisher.updateDistroSeriesPackageCache(test_data["distroseries"])

        # updateDistroSeriesPackageCache reconnects the db, so the
        # objects need to be reloaded.
        distroseries = getUtility(IDistroSeriesSet).get(distroseries_id)
        return distroseries.getSourcePackage(source_package_name)
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:11,代码来源:test_sourcepackage_views.py

示例8: test_can_run_twice

    def test_can_run_twice(self):
        test_publisher = SoyuzTestPublisher()
        distroseries = test_publisher.setUpDefaultDistroSeries()
        distro = distroseries.distribution
        self.factory.makeComponentSelection(
            distroseries=distroseries, component="main")
        self.factory.makeArchive(
            distribution=distro, purpose=ArchivePurpose.PARTNER)
        test_publisher.getPubSource()

        self.setUpForScriptRun(distro)
        self.makeScript(distro).main()
        self.makeScript(distro).main()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:13,代码来源:test_publish_ftpmaster.py

示例9: test_publishes_package

    def test_publishes_package(self):
        test_publisher = SoyuzTestPublisher()
        distroseries = test_publisher.setUpDefaultDistroSeries()
        distro = distroseries.distribution
        pub_config = get_pub_config(distro)
        self.factory.makeComponentSelection(
            distroseries=distroseries, component="main")
        self.factory.makeArchive(
            distribution=distro, purpose=ArchivePurpose.PARTNER)
        test_publisher.getPubSource()

        self.setUpForScriptRun(distro)
        self.makeScript(distro).main()

        archive_root = get_archive_root(pub_config)
        dists_root = get_dists_root(pub_config)

        dsc = os.path.join(
            archive_root, 'pool', 'main', 'f', 'foo', 'foo_666.dsc')
        self.assertEqual("I do not care about sources.", file(dsc).read())
        overrides = os.path.join(
            archive_root + '-overrides', distroseries.name + '_main_source')
        self.assertEqual(dsc, file(overrides).read().rstrip())
        self.assertTrue(path_exists(
            dists_root, distroseries.name, 'main', 'source', 'Sources.gz'))
        self.assertTrue(path_exists(
            dists_root, distroseries.name, 'main', 'source', 'Sources.bz2'))

        distcopyseries = os.path.join(dists_root, distroseries.name)
        release = self.readReleaseFile(
            os.path.join(distcopyseries, "Release"))
        self.assertEqual(distro.displayname, release['Origin'])
        self.assertEqual(distro.displayname, release['Label'])
        self.assertEqual(distroseries.name, release['Suite'])
        self.assertEqual(distroseries.name, release['Codename'])
        self.assertEqual("main", release['Components'])
        self.assertEqual("", release["Architectures"])
        self.assertIn("Date", release)
        self.assertIn("Description", release)
        self.assertNotEqual("", release["MD5Sum"])
        self.assertNotEqual("", release["SHA1"])
        self.assertNotEqual("", release["SHA256"])

        main_release = self.readReleaseFile(
            os.path.join(distcopyseries, 'main', 'source', "Release"))
        self.assertEqual(distroseries.name, main_release["Archive"])
        self.assertEqual("main", main_release["Component"])
        self.assertEqual(distro.displayname, main_release["Origin"])
        self.assertEqual(distro.displayname, main_release["Label"])
        self.assertEqual("source", main_release["Architecture"])
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:50,代码来源:test_publish_ftpmaster.py

示例10: 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()
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:7,代码来源:test_processaccepted.py

示例11: setUp

 def setUp(self):
     super(TestBuildSet, self).setUp()
     self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
     self.processor_one = self.factory.makeProcessor()
     self.processor_two = self.factory.makeProcessor()
     self.distroseries = self.factory.makeDistroSeries()
     self.distribution = self.distroseries.distribution
     self.das_one = self.factory.makeDistroArchSeries(
         distroseries=self.distroseries, processor=self.processor_one,
         supports_virtualized=True)
     self.das_two = self.factory.makeDistroArchSeries(
         distroseries=self.distroseries, processor=self.processor_two,
         supports_virtualized=True)
     self.archive = self.factory.makeArchive(
         distribution=self.distroseries.distribution,
         purpose=ArchivePurpose.PRIMARY)
     with person_logged_in(self.admin):
         self.publisher = SoyuzTestPublisher()
         self.publisher.prepareBreezyAutotest()
         self.distroseries.nominatedarchindep = self.das_one
         self.publisher.addFakeChroots(distroseries=self.distroseries)
         self.builder_one = self.factory.makeBuilder(
             processor=self.processor_one)
         self.builder_two = self.factory.makeBuilder(
             processor=self.processor_two)
     self.builds = []
     self.spphs = []
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:27,代码来源:test_build_set.py

示例12: setUp

 def setUp(self):
     super(TestBuildNotify, self).setUp()
     self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
     # Create all of the items we need to create builds
     self.processor = self.factory.makeProcessor()
     self.distroseries = self.factory.makeDistroSeries()
     self.das = self.factory.makeDistroArchSeries(
         distroseries=self.distroseries, processor=self.processor,
         supports_virtualized=True)
     self.creator = self.factory.makePerson(email='[email protected]')
     self.gpgkey = self.factory.makeGPGKey(owner=self.creator)
     self.archive = self.factory.makeArchive(
         distribution=self.distroseries.distribution,
         purpose=ArchivePurpose.PRIMARY)
     self.ppa = self.factory.makeArchive()
     buildd_admins = getUtility(IPersonSet).getByName(
         'launchpad-buildd-admins')
     self.buildd_admins_email = []
     with person_logged_in(self.admin):
         self.publisher = SoyuzTestPublisher()
         self.publisher.prepareBreezyAutotest()
         self.distroseries.nominatedarchindep = self.das
         self.publisher.addFakeChroots(distroseries=self.distroseries)
         self.builder = self.factory.makeBuilder(processor=self.processor)
         for member in buildd_admins.activemembers:
             self.buildd_admins_email.append(member.preferredemail.email)
     self.builds = []
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:27,代码来源:test_build_notify.py

示例13: setUp

 def setUp(self):
     super(TestDistributionHasBuildRecords, self).setUp()
     self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
     # Create the machinery we need to create builds, such as
     # DistroArchSeries and builders.
     self.processor_one = self.factory.makeProcessor()
     self.processor_two = self.factory.makeProcessor()
     self.distroseries = self.factory.makeDistroSeries()
     self.distribution = self.distroseries.distribution
     self.das_one = self.factory.makeDistroArchSeries(
         distroseries=self.distroseries, processor=self.processor_one,
         supports_virtualized=True)
     self.das_two = self.factory.makeDistroArchSeries(
         distroseries=self.distroseries, processor=self.processor_two,
         supports_virtualized=True)
     self.archive = self.factory.makeArchive(
         distribution=self.distroseries.distribution,
         purpose=ArchivePurpose.PRIMARY)
     self.arch_ids = [arch.id for arch in self.distroseries.architectures]
     with person_logged_in(self.admin):
         self.publisher = SoyuzTestPublisher()
         self.publisher.prepareBreezyAutotest()
         self.distroseries.nominatedarchindep = self.das_one
         self.publisher.addFakeChroots(distroseries=self.distroseries)
         self.builder_one = self.factory.makeBuilder(
             processor=self.processor_one)
         self.builder_two = self.factory.makeBuilder(
             processor=self.processor_two)
     self.builds = []
     self.createBuilds()
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:30,代码来源:test_hasbuildrecords.py

示例14: setUp

 def setUp(self):
     super(TestDetermineArchitecturesToBuild, self).setUp()
     self.publisher = SoyuzTestPublisher()
     self.publisher.prepareBreezyAutotest()
     armel = self.factory.makeProcessor('armel', 'armel', 'armel')
     self.publisher.breezy_autotest.newArch(
         'armel', armel, False, self.publisher.person)
     self.publisher.addFakeChroots()
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:8,代码来源:test_buildarch.py

示例15: setUp

 def setUp(self):
     super(TestDistroSourcePackageReleaseFiles, self).setUp()
     # The package must be published for the page to render.
     stp = SoyuzTestPublisher()
     distroseries = stp.setUpDefaultDistroSeries()
     naked_distroseries = remove_security_proxy_and_shout_at_engineer(
         distroseries)
     # XXX Abel Deuring, 2010-07-21, bug 608240. This is scary. But
     # if we use distroseries.distribution instead,
     # test_spr_files_deleted() and test_spr_files_one() fail.
     distro = naked_distroseries.distribution
     source_package_release = stp.getPubSource().sourcepackagerelease
     self.dspr = DistributionSourcePackageRelease(
         distro, source_package_release)
     self.library_file = self.factory.makeLibraryFileAlias(
         filename='test_file.dsc', content='0123456789')
     source_package_release.addFile(self.library_file)
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:17,代码来源:test_distrosourcepackagerelease.py


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