diff --git a/.gitignore b/.gitignore index 1e06ed9e..8259196f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ dist build .DS_Store test_project -Pipfile.lock \ No newline at end of file +Pipfile.lock +/.vscode/ diff --git a/pipenv/cli.py b/pipenv/cli.py index fa3b5e36..c54a8235 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1628,7 +1628,7 @@ def install( ), default=True ): - package_names[0] = package_name + package_names[0] = suggested_package # Install all dependencies, if none was provided. if package_name is False: diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index c2359630..27b65da4 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -20,15 +20,11 @@ class PipenvInstance(): self.pipfile_path = p_path def __enter__(self): - if not self.pipfile_path: - os.chdir(self.path) - + os.chdir(self.path) return self def __exit__(self, *args): - if not self.pipfile_path: - os.chdir(self.original_dir) - + os.chdir(self.original_dir) shutil.rmtree(self.path) def pipenv(self, cmd, block=True): @@ -126,15 +122,16 @@ class TestPipenv: assert 'urllib3' in p.lockfile['default'] assert 'certifi' in p.lockfile['default'] - # def test_spell_checking(self): - # with PipenvInstance() as p: - # c = p.pipenv('install django-rest-framework', block=False) - # c.expect('?') - # c.send('y') - # c.block() + def test_spell_checking(self): + with PipenvInstance() as p: + c = p.pipenv('install flaskcors', block=False) + c.expect(u'[Y//n]:') + c.send('y') + c.block() - # assert c.return_code == 0 - # assert 'requests' in p.pipfile['djangorestframework'] + assert c.return_code == 0 + assert 'flask-cors' in p.pipfile['packages'] + assert 'flask' in p.lockfile['default'] def test_basic_install(self): with PipenvInstance() as p: @@ -335,7 +332,7 @@ requests = {version = "*"} def test_bad_packages(self): with PipenvInstance() as p: - c = p.pipenv('install python') + c = p.pipenv('install NotAPackage') assert c.return_code > 0 def test_venv_in_project(self):