add unittest for running single api

This commit is contained in:
debugtalk
2018-12-16 00:38:02 +08:00
parent 5beb25470f
commit f0d6bda573
3 changed files with 19 additions and 3 deletions

View File

@@ -211,10 +211,10 @@ class HttpRunner(object):
dict: valid testcase/testsuite data
"""
if validator.is_testcases(path_or_tests):
return self.run_tests(path_or_tests)
elif validator.is_testcase_path(path_or_tests):
if validator.is_testcase_path(path_or_tests):
return self.run_path(path_or_tests, dot_env_path, mapping)
elif validator.is_testcases(path_or_tests):
return self.run_tests(path_or_tests)
else:
raise exceptions.ParamsError("invalid testcase path or testcases.")