load_testcases_by_path: make compatible with none exist path

This commit is contained in:
debugtalk
2017-06-27 19:17:48 +08:00
parent c42c915b6d
commit acdd5599a4
2 changed files with 23 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ def load_testcases_by_path(path):
files_list = load_foler_files(path)
return load_testcases_by_path(files_list)
if os.path.isfile(path):
elif os.path.isfile(path):
testset = {
"name": "",
"config": {},
@@ -187,3 +187,6 @@ def load_testcases_by_path(path):
testset["testcases"].append(item["test"])
return [testset]
else:
return []