本文整理匯總了Python中zeroinstall.injector.requirements.Requirements.get_extra_restrictions方法的典型用法代碼示例。如果您正苦於以下問題:Python Requirements.get_extra_restrictions方法的具體用法?Python Requirements.get_extra_restrictions怎麽用?Python Requirements.get_extra_restrictions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zeroinstall.injector.requirements.Requirements
的用法示例。
在下文中一共展示了Requirements.get_extra_restrictions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testReplacedConflicts
# 需要導入模塊: from zeroinstall.injector.requirements import Requirements [as 別名]
# 或者: from zeroinstall.injector.requirements.Requirements import get_extra_restrictions [as 別名]
def testReplacedConflicts(self):
self.import_feed('http://localhost:8000/Hello', 'Hello')
s = solver.DefaultSolver(self.config)
replaced_path = model.canonical_iface_uri(os.path.join(mydir, 'Replaced.xml'))
replaced_conflicts_path = model.canonical_iface_uri(os.path.join(mydir, 'ReplacedConflicts.xml'))
r = Requirements(replaced_conflicts_path)
s.solve_for(r)
assert s.ready, s.get_failure_reason()
assert s.selections
self.assertEqual("b", s.selections.selections[replaced_conflicts_path].id)
self.assertEqual("2", s.selections.selections[replaced_conflicts_path].version)
self.assertEqual("sha1=3ce644dc725f1d21cfcf02562c76f375944b266a", s.selections.selections["http://localhost:8000/Hello"].id)
self.assertEqual(2, len(s.selections.selections))
r.extra_restrictions[r.interface_uri] = '..!2'
s.extra_restrictions = r.get_extra_restrictions(self.config.iface_cache)
s.solve_for(r)
assert s.ready, s.get_failure_reason()
assert s.selections
self.assertEqual("1", s.selections.selections[replaced_conflicts_path].version)
self.assertEqual("0", s.selections.selections[replaced_path].version)
self.assertEqual(2, len(s.selections.selections))