本文整理匯總了Python中yum_importer.importer.YumImporter.resolve_dependencies方法的典型用法代碼示例。如果您正苦於以下問題:Python YumImporter.resolve_dependencies方法的具體用法?Python YumImporter.resolve_dependencies怎麽用?Python YumImporter.resolve_dependencies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yum_importer.importer.YumImporter
的用法示例。
在下文中一共展示了YumImporter.resolve_dependencies方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_resolve_deps
# 需要導入模塊: from yum_importer.importer import YumImporter [as 別名]
# 或者: from yum_importer.importer.YumImporter import resolve_dependencies [as 別名]
def test_resolve_deps(self):
repo = mock.Mock(spec=Repository)
repo.working_dir = "/tmp/test_resolve_deps"
repo.id = "test_resolve_deps"
unit_key_a = {'id' : '','name' :'pulp-server', 'version' :'0.0.309', 'release' : '1.fc17', 'epoch':'0', 'arch' : 'noarch', 'checksumtype' : 'sha256',
'checksum': 'ee5afa0aaf8bd2130b7f4a9b35f4178336c72e95358dd33bda8acaa5f28ea6e9', 'type_id' : 'rpm'}
unit_key_a_obj = Unit(RPM_TYPE_ID, unit_key_a, {}, '')
unit_key_a_obj.metadata = constants.PULP_SERVER_RPM_METADATA
unit_key_b = {'id' : '', 'name' :'pulp-rpm-server', 'version' :'0.0.309', 'release' :'1.fc17', 'epoch':'0','arch' : 'noarch', 'checksumtype' :'sha256',
'checksum': '1e6c3a3bae26423fe49d26930b986e5f5ee25523c13f875dfcd4bf80f770bf56', 'type_id' : 'rpm', }
unit_key_b_obj = Unit(RPM_TYPE_ID, unit_key_b, {}, '')
unit_key_b_obj.metadata = constants.PULP_RPM_SERVER_RPM_METADATA
existing_units = []
for unit in [unit_key_a_obj, unit_key_b_obj]:
existing_units.append(unit)
conduit = importer_mocks.get_dependency_conduit(type_id=RPM_TYPE_ID, existing_units=existing_units, pkg_dir=self.pkg_dir)
config = importer_mocks.get_basic_config()
importer = YumImporter()
units = [Unit(RPM_TYPE_ID, unit_key_b, {}, '')]
result = importer.resolve_dependencies(repo, units, conduit, config)
self.assertEqual(len(list(itertools.chain(*result['resolved'].values()))), 1)
self.assertEqual(len(list(itertools.chain(*result['unresolved'].values()))), 0)