Improve test -n and -p failure messages

pull/1976/head
Jimmy Brisson 2016-06-22 11:26:41 -05:00
parent 2fc4d64b07
commit 91c45a7b6f
1 changed files with 2 additions and 2 deletions

View File

@ -1223,7 +1223,7 @@ TEST_MAP = dict([(test['id'], Test(i)) for i, test in enumerate(TESTS)])
def test_known(string):
i = int(string)
if i >= 0 and i < len(TESTS) : return i
else : raise ArgumentTypeError("{0} does not index a test".format(i))
else : raise ArgumentTypeError("{0} does not index a test. The accepted range is 0 to {1}".format(i, len(TEST_MAP) - 1))
def test_name_known(string):
nlist = string.split(',')
@ -1231,6 +1231,6 @@ def test_name_known(string):
if test_id not in TEST_MAP.keys():
if getattr(ps, "test_alias", None) is None or \
ps.test_alias.get(test_id, "") not in TEST_MAP.keys():
raise ArgumentTypeError("Program with name '%s' not found"% test_id)
raise ArgumentTypeError("Program with name '{0}' not found. Supported tests are {1}".format(test_id, ", ".join(TEST_MAP.keys())))
return [TEST_MAP[n].n for n in nlist]