refactor api loading behavior: api should be located in /tests/api/ folder

This commit is contained in:
debugtalk
2017-09-21 20:54:06 +08:00
parent 495b8d97ab
commit 7aefc7a13b
5 changed files with 37 additions and 50 deletions

View File

@@ -59,11 +59,10 @@ def load_testcases(testcase_file_path):
# '' or other suffix
return []
def load_folder_files(folder_path, file_type, recursive=False):
def load_folder_files(folder_path, recursive=True):
""" load folder path, return all files in list format.
@param
folder_path: specified folder path to load
file_type: "test" or "api"
recursive: if True, will load files recursively
"""
file_list = []
@@ -72,13 +71,9 @@ def load_folder_files(folder_path, file_type, recursive=False):
filenames_list = []
for filename in filenames:
if not filename.endswith(('.yml', '.yaml', '.json')):
continue
if file_type == "api" and not filename.startswith(('api.', 'api-')):
continue
filenames_list.append(filename)
for filename in filenames_list: