From 6e7fee8ce90dc6085740e83dbcfdf0d537d62eae Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 10 Jun 2017 04:01:49 -0600 Subject: [PATCH] added timeout tests for short and long timeouts --- tests/test_pipenv.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 9e4135f6..78d255e1 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -63,6 +63,37 @@ class TestPipenv(): os.chdir('..') delegator.run('rm -fr test_project') + def test_timeout_long(self): + delegator.run('mkdir test_timeout_long') + os.chdir('test_timeout_long') + + os.environ['PIPENV_VENV_IN_PROJECT'] = '1' + os.environ['PIPENV_TIMEOUT'] = '60' + + assert delegator.run('touch Pipfile').return_code == 0 + + assert delegator.run('pipenv --python python').return_code == 0 + + os.chdir('..') + delegator.run('rm -fr test_timeout_long') + del os.environ['PIPENV_TIMEOUT'] + + def test_timeout_short(self): + delegator.run('mkdir test_timeout_short') + os.chdir('test_timeout_short') + + os.environ['PIPENV_VENV_IN_PROJECT'] = '1' + os.environ['PIPENV_TIMEOUT'] = '1' + print(os.environ['PIPENV_TIMEOUT']) + + assert delegator.run('touch Pipfile').return_code == 0 + + assert delegator.run('pipenv --python python').return_code == 1 + + os.chdir('..') + delegator.run('rm -fr test_timeout_short') + del os.environ['PIPENV_TIMEOUT'] + def test_pipenv_uninstall(self): delegator.run('mkdir test_pipenv_uninstall') os.chdir('test_pipenv_uninstall')