Skip to content

Commit

Permalink
Add test_finder.test_tilde unit test
Browse files Browse the repository at this point in the history
Adds a `test_tilde` test to augment @pfmoore's work in
pypa#2455 ("Normalize paths starting with ~
in find-links")

This would've caught the missing import problem we had
(pfmoore#1).
  • Loading branch information
msabramo committed Mar 11, 2015
1 parent 98df838 commit 886f38e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/test_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ def test_no_partial_name_match(data):
assert found.url.endswith("gmpy-1.15.tar.gz"), found


@patch(
'pip.index.os.path.exists',
return_value=True # b/c we only use tilde expanded version if it exists
)
def test_tilde(data):
"""Finder can accept a path with ~ in it and will normalize it."""
finder = PackageFinder(['~/python-pkgs'], [], session=PipSession())
req = InstallRequirement.from_line("gmpy")
with pytest.raises(DistributionNotFound):
finder.find_requirement(req, False)


def test_duplicates_sort_ok(data):
"""Finder successfully finds one of a set of duplicates in different
locations"""
Expand Down

0 comments on commit 886f38e

Please sign in to comment.