本文整理汇总了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"
示例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"
示例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
)