• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python upload._generate_rpm_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp_rpm.plugins.importers.yum.upload._generate_rpm_data函数的典型用法代码示例。如果您正苦于以下问题:Python _generate_rpm_data函数的具体用法?Python _generate_rpm_data怎么用?Python _generate_rpm_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_user_metadata_present_no_checksum_type

 def test_user_metadata_present_no_checksum_type(self):
     """
     Test that when user metadata is provided, but doesn't contain a checksum type, the default
     type is used.
     """
     unit_key, metadata = upload._generate_rpm_data(models.RPM.TYPE, RPM_USUAL_NAME, {})
     self.assertEquals(util.TYPE_SHA256, unit_key['checksumtype'])
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:7,代码来源:test_yumplugin_upload.py


示例2: test_user_metadata_present_with_checksum_type

 def test_user_metadata_present_with_checksum_type(self):
     """
     Test that when user metadata is provided and contains a checksum type, that type is used
     """
     unit_key, metadata = upload._generate_rpm_data(models.RPM.TYPE,
                                                    RPM_USUAL_NAME,
                                                    {'checksum_type': util.TYPE_MD5})
     self.assertEquals(util.TYPE_MD5, unit_key['checksumtype'])
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:8,代码来源:test_yumplugin_upload.py


示例3: test_generate_rpm_data

    def test_generate_rpm_data(self):
        # Test
        unit_key, metadata = upload._generate_rpm_data(self.upload_src_filename, {})

        # Verify
        self.assertEqual(unit_key['name'], 'walrus')
        self.assertEqual(unit_key['epoch'], '0')
        self.assertEqual(unit_key['version'], '5.21')
        self.assertEqual(unit_key['release'], '1')
        self.assertEqual(unit_key['arch'], 'noarch')
        self.assertEqual(unit_key['checksum'], 'e837a635cc99f967a70f34b268baa52e0f412c1502e08e924ff5b09f1f9573f2')
        self.assertEqual(unit_key['checksumtype'], 'sha256')

        self.assertEqual(metadata['buildhost'], 'smqe-ws15')
        self.assertEqual(metadata['description'], 'A dummy package of walrus')
        self.assertEqual(metadata['filename'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['license'], 'GPLv2')
        self.assertEqual(metadata['relativepath'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['vendor'], None)
开发者ID:preethit,项目名称:pulp_rpm,代码行数:19,代码来源:test_upload.py


示例4: test_generate_rpm_data_user_checksum

    def test_generate_rpm_data_user_checksum(self):
        # Test
        unit_key, metadata = upload._generate_rpm_data(self.upload_src_filename,
                                                       {'checksum-type': 'sha1'})

        # Verify
        self.assertEqual(unit_key['name'], 'walrus')
        self.assertEqual(unit_key['epoch'], '0')
        self.assertEqual(unit_key['version'], '5.21')
        self.assertEqual(unit_key['release'], '1')
        self.assertEqual(unit_key['arch'], 'noarch')
        self.assertEqual(unit_key['checksum'], '8dea2b64fc52062d79d5f96ba6415bffae4d2153')
        self.assertEqual(unit_key['checksumtype'], 'sha1')

        self.assertEqual(metadata['buildhost'], 'smqe-ws15')
        self.assertEqual(metadata['description'], 'A dummy package of walrus')
        self.assertEqual(metadata['filename'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['license'], 'GPLv2')
        self.assertEqual(metadata['relativepath'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['vendor'], None)
开发者ID:preethit,项目名称:pulp_rpm,代码行数:20,代码来源:test_upload.py


示例5: test_generate_rpm_data_user_checksum_null

    def test_generate_rpm_data_user_checksum_null(self):
        # Test
        unit_key, metadata = upload._generate_rpm_data(
            models.RPM.TYPE, self.upload_src_filename, {"checksum_type": None}
        )

        # Verify
        self.assertEqual(unit_key["name"], "walrus")
        self.assertEqual(unit_key["epoch"], "0")
        self.assertEqual(unit_key["version"], "5.21")
        self.assertEqual(unit_key["release"], "1")
        self.assertEqual(unit_key["arch"], "noarch")
        self.assertEqual(unit_key["checksum"], "e837a635cc99f967a70f34b268baa52e0f412c1502e08e924ff5b09f1f9573f2")
        self.assertEqual(unit_key["checksumtype"], "sha256")

        self.assertEqual(metadata["buildhost"], "smqe-ws15")
        self.assertEqual(metadata["description"], "A dummy package of walrus")
        self.assertEqual(metadata["filename"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["license"], "GPLv2")
        self.assertEqual(metadata["relativepath"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["vendor"], None)
开发者ID:hjensas,项目名称:pulp_rpm,代码行数:21,代码来源:test_upload.py


示例6: test_generate_rpm_data_user_checksum

    def test_generate_rpm_data_user_checksum(self):
        # Test
        unit_key, metadata = upload._generate_rpm_data(
            models.RPM.TYPE, self.upload_src_filename, {"checksum_type": "sha1"}
        )

        # Verify
        self.assertEqual(unit_key["name"], "walrus")
        self.assertEqual(unit_key["epoch"], "0")
        self.assertEqual(unit_key["version"], "5.21")
        self.assertEqual(unit_key["release"], "1")
        self.assertEqual(unit_key["arch"], "noarch")
        self.assertEqual(unit_key["checksum"], "8dea2b64fc52062d79d5f96ba6415bffae4d2153")
        self.assertEqual(unit_key["checksumtype"], "sha1")

        self.assertEqual(metadata["buildhost"], "smqe-ws15")
        self.assertEqual(metadata["description"], "A dummy package of walrus")
        self.assertEqual(metadata["filename"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["license"], "GPLv2")
        self.assertEqual(metadata["relativepath"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["vendor"], None)
开发者ID:hjensas,项目名称:pulp_rpm,代码行数:21,代码来源:test_upload.py


示例7: test__generate_rpm_data_sanitizes_checksum_type

    def test__generate_rpm_data_sanitizes_checksum_type(self):
        """
        Assert that _generate_rpm_data() sanitizes the checksum type.
        """
        unit_key, metadata = upload._generate_rpm_data(models.RPM.TYPE,
                                                       self.upload_src_filename,
                                                       {'checksum_type': 'sha'})

        self.assertEqual(unit_key['name'], 'walrus')
        self.assertEqual(unit_key['epoch'], '0')
        self.assertEqual(unit_key['version'], '5.21')
        self.assertEqual(unit_key['release'], '1')
        self.assertEqual(unit_key['arch'], 'noarch')
        self.assertEqual(unit_key['checksum'], '8dea2b64fc52062d79d5f96ba6415bffae4d2153')
        # The checksumtype is sha1, even though it was set to sha because it was sanitized.
        self.assertEqual(unit_key['checksumtype'], 'sha1')

        self.assertEqual(metadata['buildhost'], 'smqe-ws15')
        self.assertEqual(metadata['description'], 'A dummy package of walrus')
        self.assertEqual(metadata['filename'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['license'], 'GPLv2')
        self.assertEqual(metadata['relativepath'], 'walrus-5.21-1.noarch.rpm')
        self.assertEqual(metadata['vendor'], None)
开发者ID:dkliban,项目名称:pulp_rpm,代码行数:23,代码来源:test_upload.py


示例8: test__generate_rpm_data_sanitizes_checksum_type

    def test__generate_rpm_data_sanitizes_checksum_type(self):
        """
        Assert that _generate_rpm_data() sanitizes the checksum type.
        """
        unit_key, metadata = upload._generate_rpm_data(
            models.RPM.TYPE, self.upload_src_filename, {"checksum_type": "sha"}
        )

        self.assertEqual(unit_key["name"], "walrus")
        self.assertEqual(unit_key["epoch"], "0")
        self.assertEqual(unit_key["version"], "5.21")
        self.assertEqual(unit_key["release"], "1")
        self.assertEqual(unit_key["arch"], "noarch")
        self.assertEqual(unit_key["checksum"], "8dea2b64fc52062d79d5f96ba6415bffae4d2153")
        # The checksumtype is sha1, even though it was set to sha because it was sanitized.
        self.assertEqual(unit_key["checksumtype"], "sha1")

        self.assertEqual(metadata["buildhost"], "smqe-ws15")
        self.assertEqual(metadata["description"], "A dummy package of walrus")
        self.assertEqual(metadata["filename"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["license"], "GPLv2")
        self.assertEqual(metadata["relativepath"], "walrus-5.21-1.noarch.rpm")
        self.assertEqual(metadata["vendor"], None)
开发者ID:hjensas,项目名称:pulp_rpm,代码行数:23,代码来源:test_upload.py


示例9: test_srpm_filename

 def test_srpm_filename(self):
     unit_key, metadata = upload._generate_rpm_data(models.SRPM.TYPE, SRPM_USUAL_NAME, {})
     self.assertEquals('test-srpm01-1.0-1.src.rpm', metadata['filename'])
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:3,代码来源:test_yumplugin_upload.py


示例10: test_unusual_filename

 def test_unusual_filename(self):
     unit_key, metadata = upload._generate_rpm_data(models.RPM.TYPE, RPM_UNUSUAL_NAME, {})
     self.assertEquals('pulp-test-package-0.3.1-1.fc11.x86_64.rpm', metadata['filename'])
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:3,代码来源:test_yumplugin_upload.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python upload.upload函数代码示例发布时间:2022-05-25
下一篇:
Python packages.package_list_generator函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap