コード例 #1
0
ファイル: test_index.py プロジェクト: Basis/pip
def test_sort_locations_file_find_link():
    """
    Test that a file:// find-link dir gets listdir run
    """
    finder = PackageFinder([find_links], [])
    files, urls = finder._sort_locations([find_links])
    assert files and not urls, "files and not urls should have been found at find-links url: %s" % find_links
コード例 #2
0
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([], [])
    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
0
def test_sort_locations_file_find_link(data):
    """
    Test that a file:// find-link dir gets listdir run
    """
    finder = PackageFinder([data.find_links], [])
    files, urls = finder._sort_locations([data.find_links])
    assert files and not urls, "files and not urls should have been found at find-links url: %s" % data.find_links
コード例 #4
0
ファイル: test_index.py プロジェクト: 1stvamp/pip
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([], [])
    files, urls = finder._sort_locations(data.index_url("empty_with_pkg"))
    assert urls and not files, "urls, but not files should have been found"
コード例 #5
0
ファイル: test_index.py プロジェクト: zongfang/pip
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"
コード例 #6
0
ファイル: test_index.py プロジェクト: Basis/pip
def test_sort_locations_file_not_find_link():
    """
    Test that a file:// url dir that's not a find-link, doesn't get a listdir run
    """
    index_url = path_to_url(os.path.join(tests_data, 'indexes', 'empty_with_pkg'))
    finder = PackageFinder([], [])
    files, urls = finder._sort_locations([index_url])
    assert urls and not files, "urls, but not files should have been found"
コード例 #7
0
ファイル: test_index.py プロジェクト: Euphorix/pip
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"
コード例 #8
0
ファイル: test_index.py プロジェクト: genome-vendor/flow-pip
def test_sort_locations_file_not_find_link():
    """
    Test that a file:// url dir that's not a find-link, doesn't get a listdir run
    """
    index_url = path_to_url(os.path.join(here, 'indexes', 'empty_with_pkg'))
    finder = PackageFinder([], [])
    files, urls = finder._sort_locations([index_url])
    assert urls and not files, "urls, but not files should have been found"
コード例 #9
0
ファイル: test_index.py プロジェクト: zongfang/pip
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)
コード例 #10
0
ファイル: test_index.py プロジェクト: genome-vendor/flow-pip
def test_sort_locations_file_find_link():
    """
    Test that a file:// find-link dir gets listdir run
    """
    find_links_url = path_to_url(os.path.join(here, 'packages'))
    find_links = [find_links_url]
    finder = PackageFinder(find_links, [])
    files, urls = finder._sort_locations(find_links)
    assert files and not urls, "files and not urls should have been found at find-links url: %s" % find_links_url
コード例 #11
0
ファイル: test_index.py プロジェクト: saxix/pip
def test_sort_locations_file_find_link():
    """
    Test that a file:// find-link dir gets listdir run
    """
    find_links_url = path_to_url(os.path.join(here, 'packages'))
    find_links = [find_links_url]
    finder = PackageFinder(find_links, [])
    files, urls = finder._sort_locations(find_links)
    assert files and not urls, "files and not urls should have been found at find-links url: %s" % find_links_url
コード例 #12
0
ファイル: test_index.py プロジェクト: MathewJennings/pip
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
    )