From 87b4564fa95cd2049f7d9ccfaeb30b6f3e0e8770 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Fri, 22 Sep 2017 23:56:48 -0600 Subject: [PATCH 1/8] remove .vscode settings --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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/ From ed58f25b5d0d2fa0cd2ca2b98d142273f4443ef2 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 00:47:45 -0600 Subject: [PATCH 2/8] uncommented test_pipenv_check and test_spell_check Signed-off-by: Erin O'Connell --- tests/test_pipenv.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index c2359630..234c7149 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -93,10 +93,10 @@ class TestPipenv: assert 'requests' in p.pipenv('graph').out assert 'requests' in p.pipenv('graph --json').out - # def test_pipenv_check(self): - # with PipenvInstance() as p: - # p.pipenv('install requests==1.0.0') - # assert 'requests' in p.pipenv('check').out + def test_pipenv_check(self): + with PipenvInstance() as p: + p.pipenv('install requests==1.0.0') + assert 'requests' in p.pipenv('check').out def test_venv_envs(self): with PipenvInstance() as p: @@ -126,15 +126,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 django-rest-framework', block=False) + c.expect('[Y/n]:') + c.send('y') + c.block() - # assert c.return_code == 0 - # assert 'requests' in p.pipfile['djangorestframework'] + assert c.return_code == 0 + print(p.lockfile) + assert 'requests' in p.lockfile['djangorestframework'] def test_basic_install(self): with PipenvInstance() as p: From c94fb4b7ec5bcd1efe728019e18f34a0028215f6 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 01:06:45 -0600 Subject: [PATCH 3/8] The new spell-check test passing! --- pipenv/cli.py | 2 +- tests/test_pipenv.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 234c7149..3e52f624 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -128,14 +128,14 @@ class TestPipenv: def test_spell_checking(self): with PipenvInstance() as p: - c = p.pipenv('install django-rest-framework', block=False) + c = p.pipenv('install flaskcors', block=False) c.expect('[Y/n]:') c.send('y') c.block() assert c.return_code == 0 - print(p.lockfile) - assert 'requests' in p.lockfile['djangorestframework'] + assert 'flask-cors' in p.pipfile['packages'] + assert 'flask' in p.lockfile['default'] def test_basic_install(self): with PipenvInstance() as p: From 534f1c28f4da1422664ae92c3b9fe81678d962f1 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 01:31:22 -0600 Subject: [PATCH 4/8] fixed regex issue --- tests/test_pipenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 3e52f624..c2d39c44 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -129,7 +129,7 @@ class TestPipenv: def test_spell_checking(self): with PipenvInstance() as p: c = p.pipenv('install flaskcors', block=False) - c.expect('[Y/n]:') + c.expect('[Y//n]:') c.send('y') c.block() From 7c1e44aa94e248dd94e829e3fe9634e5b962ce86 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 01:50:04 -0600 Subject: [PATCH 5/8] fix for python 2 --- tests/test_pipenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index c2d39c44..caf5194b 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -129,7 +129,7 @@ class TestPipenv: def test_spell_checking(self): with PipenvInstance() as p: c = p.pipenv('install flaskcors', block=False) - c.expect('[Y//n]:') + c.expect(u'[Y//n]:') c.send('y') c.block() From 8de279d3af284fa6bf101cab20b4161bdf4ed5ae Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 01:56:12 -0600 Subject: [PATCH 6/8] this test doesn't involve this bug, will fix later --- tests/test_pipenv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index caf5194b..0c061fb9 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -93,10 +93,10 @@ class TestPipenv: assert 'requests' in p.pipenv('graph').out assert 'requests' in p.pipenv('graph --json').out - def test_pipenv_check(self): - with PipenvInstance() as p: - p.pipenv('install requests==1.0.0') - assert 'requests' in p.pipenv('check').out + # def test_pipenv_check(self): + # with PipenvInstance() as p: + # p.pipenv('install requests==1.0.0') + # assert 'requests' in p.pipenv('check').out def test_venv_envs(self): with PipenvInstance() as p: From 855f279929ef13931f7ab309b12857f53a1cba86 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 02:34:54 -0600 Subject: [PATCH 7/8] fix? --- tests/test_pipenv.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 0c061fb9..00d5a4dc 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): From a1a9a64c02a53087b80539447e2901bd1609f1e6 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Sep 2017 03:09:39 -0600 Subject: [PATCH 8/8] fix for app veyor python2.7 --- tests/test_pipenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 00d5a4dc..27b65da4 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -332,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):