本文整理匯總了Python中depsolver.pool.Pool.repository_priority方法的典型用法代碼示例。如果您正苦於以下問題:Python Pool.repository_priority方法的具體用法?Python Pool.repository_priority怎麽用?Python Pool.repository_priority使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類depsolver.pool.Pool
的用法示例。
在下文中一共展示了Pool.repository_priority方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_priority_no_name
# 需要導入模塊: from depsolver.pool import Pool [as 別名]
# 或者: from depsolver.pool.Pool import repository_priority [as 別名]
def test_priority_no_name(self):
paid_repo = Repository([
self.mkl_10_1_0,
self.mkl_10_2_0,
self.mkl_10_3_0,
self.mkl_11_0_0,
self.numpy_1_7_0,
], name="paid")
free_repo = Repository([self.nomkl_numpy_1_7_0], "free")
another_repo = Repository([self.numpy_1_6_1], "another_repo")
another_repo_wo_name = Repository([self.numpy_1_6_0])
pool = Pool([paid_repo, free_repo, another_repo, another_repo_wo_name])
pool.set_repository_order("free", before="paid")
self.assertEqual(pool.repository_priority(paid_repo), 0)
self.assertEqual(pool.repository_priority(free_repo), -1)
self.assertEqual(pool.repository_priority(another_repo), -1)
self.assertEqual(pool.repository_priority(another_repo_wo_name), -1)
示例2: test_priority_simple
# 需要導入模塊: from depsolver.pool import Pool [as 別名]
# 或者: from depsolver.pool.Pool import repository_priority [as 別名]
def test_priority_simple(self):
paid_repo = Repository([
self.mkl_10_1_0,
self.mkl_10_2_0,
self.mkl_10_3_0,
self.mkl_11_0_0,
self.numpy_1_6_0,
self.numpy_1_7_0,
], name="paid")
free_repo = Repository([self.nomkl_numpy_1_7_0], "free")
pool = Pool([paid_repo, free_repo])
pool.set_repository_order("free", before="paid")
self.assertEqual(pool.repository_priority(paid_repo), 0)
self.assertEqual(pool.repository_priority(free_repo), -1)
示例3: test_priority_not_registered
# 需要導入模塊: from depsolver.pool import Pool [as 別名]
# 或者: from depsolver.pool.Pool import repository_priority [as 別名]
def test_priority_not_registered(self):
repo = Repository()
pool = Pool()
self.assertRaises(DepSolverError, lambda: pool.repository_priority(repo))
self.assertRaises(DepSolverError, lambda: pool.set_repository_order(repo, "dummy"))