本文整理汇总了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;未经允许,请勿转载。 |
请发表评论