Skip to content

Commit

Permalink
Fix test references to old requirements parser
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed Apr 20, 2018
1 parent ec22035 commit 4aa5a49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pipenv/cli.py
Expand Up @@ -12,6 +12,7 @@
pass_context,
Option,
version_option,
BadParameter,
)
from click_completion import init as init_completion
from click_completion import get_code
Expand Down Expand Up @@ -75,7 +76,7 @@ def validate_python_path(ctx, param, value):
# we'll report absolute paths which do not exist:
if isinstance(value, (str, bytes)):
if os.path.isabs(value) and not os.path.isfile(value):
raise click.BadParameter('Expected Python at path %s does not exist' % value)
raise BadParameter('Expected Python at path %s does not exist' % value)
return value


Expand Down
1 change: 0 additions & 1 deletion pipenv/project.py
Expand Up @@ -698,7 +698,6 @@ def remove_package_from_pipfile(self, package_name, dev=False):
self.write_toml(p)

def add_package_to_pipfile(self, package_name, dev=False):
from .utils import convert_deps_from_pip
# Read and append Pipfile.
p = self.parsed_pipfile
# Don't re-capitalize file URLs or VCSs.
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_utils.py
Expand Up @@ -10,7 +10,7 @@
# Pipfile format <-> requirements.txt format.
DEP_PIP_PAIRS = [
({'requests': '*'}, 'requests'),
({'requests': {'extras': ['socks']}}, 'requests[socks]'),
({'requests': {'extras': ['socks'], 'version': '*'}}, 'requests[socks]'),
({'django': '>1.10'}, 'django>1.10'),
({'Django': '>1.10'}, 'Django>1.10'),
(
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_convert_deps_to_pip_unicode():
@pytest.mark.utils
@pytest.mark.parametrize('expected, requirement', DEP_PIP_PAIRS)
def test_convert_from_pip(expected, requirement):
assert pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile() == expected
assert pipenv.requirements.PipenvRequirement.from_line(requirement).as_pipfile() == expected


@pytest.mark.utils
Expand All @@ -111,7 +111,7 @@ def test_convert_from_pip_fail_if_no_egg():
"""
dep = 'git+https://github.com/kennethreitz/requests.git'
with pytest.raises(ValueError) as e:
dep = pipenv.utils.convert_deps_from_pip(dep)
dep = pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile()
assert 'pipenv requires an #egg fragment for vcs' in str(e)


Expand All @@ -120,7 +120,7 @@ def test_convert_from_pip_git_uri_normalize():
"""Pip does not parse this correctly, but we can (by converting to ssh://).
"""
dep = 'git+git@host:user/repo.git#egg=myname'
dep = pipenv.utils.convert_deps_from_pip(dep)
dep = pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile()
assert dep == {
'myname': {
'git': 'git@host:user/repo.git',
Expand Down

0 comments on commit 4aa5a49

Please sign in to comment.