当前位置: 首页>>代码示例>>Python>>正文


Python Pool.repository_priority方法代码示例

本文整理汇总了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)
开发者ID:awwad,项目名称:depsolver,代码行数:20,代码来源:test_pool.py

示例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)
开发者ID:awwad,项目名称:depsolver,代码行数:17,代码来源:test_pool.py

示例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"))
开发者ID:awwad,项目名称:depsolver,代码行数:8,代码来源:test_pool.py


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