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


Python PackageFinder._sort_locations方法代码示例

本文整理汇总了Python中pip._internal.index.PackageFinder._sort_locations方法的典型用法代码示例。如果您正苦于以下问题:Python PackageFinder._sort_locations方法的具体用法?Python PackageFinder._sort_locations怎么用?Python PackageFinder._sort_locations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip._internal.index.PackageFinder的用法示例。


在下文中一共展示了PackageFinder._sort_locations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_sort_locations_non_existing_path

# 需要导入模块: from pip._internal.index import PackageFinder [as 别名]
# 或者: from pip._internal.index.PackageFinder import _sort_locations [as 别名]
def test_sort_locations_non_existing_path():
    """
    Test that a non-existing path is ignored.
    """
    finder = PackageFinder([], [], session=PipSession())
    files, urls = finder._sort_locations(
        [os.path.join('this', 'doesnt', 'exist')])
    assert not urls and not files, "nothing should have been found"
开发者ID:aodag,项目名称:pip,代码行数:10,代码来源:test_index.py

示例2: test_sort_locations_file_not_find_link

# 需要导入模块: from pip._internal.index import PackageFinder [as 别名]
# 或者: from pip._internal.index.PackageFinder import _sort_locations [as 别名]
def test_sort_locations_file_not_find_link(data):
    """
    Test that a file:// url dir that's not a find-link, doesn't get a listdir
    run
    """
    finder = PackageFinder([], [], session=PipSession())
    files, urls = finder._sort_locations([data.index_url("empty_with_pkg")])
    assert urls and not files, "urls, but not files should have been found"
开发者ID:aodag,项目名称:pip,代码行数:10,代码来源:test_index.py

示例3: test_sort_locations_file_expand_dir

# 需要导入模块: from pip._internal.index import PackageFinder [as 别名]
# 或者: from pip._internal.index.PackageFinder import _sort_locations [as 别名]
def test_sort_locations_file_expand_dir(data):
    """
    Test that a file:// dir gets listdir run with expand_dir
    """
    finder = PackageFinder([data.find_links], [], session=PipSession())
    files, urls = finder._sort_locations([data.find_links], expand_dir=True)
    assert files and not urls, (
        "files and not urls should have been found at find-links url: %s" %
        data.find_links
    )
开发者ID:aodag,项目名称:pip,代码行数:12,代码来源:test_index.py


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