From d14a533df3bc2cdab1b8bf26eea7379dd3f49b38 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Mon, 25 Sep 2017 01:04:11 -0600 Subject: [PATCH] added a test for converting requirements to pipfile --- tests/test_pipenv.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index e0b5077b..8087a371 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -459,7 +459,29 @@ requests = {version = "*"} c = p.pipenv('check --style .') assert 'requests' in c.out + @pytest.mark.extras + @pytest.mark.install + @pytest.mark.requirements + def test_requirements_to_pipfile(self): + with PipenvInstance(pipfile=False) as p: + # Write a requirements file + with open('requirements.txt', 'w') as f: + f.write('requests[socks]==2.18.1\n') + c = p.pipenv('install') + # Assert that the files get converted the requirements + assert p.pipfile + assert p.lockfile + # assert stuff in pipfile + assert 'requests' in p.pipfile['packages'] + assert 'extras' in p.pipfile['packages']['requests'] + + # assert stuff in lockfile + assert 'requests' in p.lockfile['default'] + assert 'chardet' in p.lockfile['default'] + assert 'idna' in p.lockfile['default'] + assert 'urllib3' in p.lockfile['default'] + assert 'pysocks' in p.lockfile['default'] \ No newline at end of file