add test for counting pre option and fix it's duplicate

This commit is contained in:
Artemiy
2019-01-24 21:29:35 +03:00
parent 44db5dd87d
commit 786cc6ef2f
2 changed files with 13 additions and 1 deletions
-1
View File
@@ -375,7 +375,6 @@ def install_options(f):
f = index_option(f)
f = extra_index_option(f)
f = requirementstxt_option(f)
f = pre_option(f)
f = selective_upgrade_option(f)
f = ignore_pipfile_option(f)
f = editable_option(f)
+13
View File
@@ -9,3 +9,16 @@ def test_help():
stderr=subprocess.STDOUT, env=os.environ.copy(),
)
assert output
def test_count_of_description_pre_option():
test_command = 'pipenv install --help'
test_line = '--pre Allow pre-releases.'
out = subprocess.Popen(test_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = out.communicate()
lines = stdout.decode().split('\n')
count = 0
for line in lines:
if line.strip().split() == test_line.split():
count += 1
assert count == 1