diff options
author | 2016-09-21 14:56:08 +0800 | |
---|---|---|
committer | 2016-09-21 14:56:08 +0800 | |
commit | 9873984d340289ab3adcd3a7abf26ea93fc87ac1 (patch) | |
tree | 63e8c20c5535fea5c40e4e86cc2fcd90b026a2e5 /utils/test/scripts/testcases_parser.py | |
parent | 6230297636c44a4a8b67d65c7222098f77228713 (diff) |
use configure file rather than arguments to organize the configuration
JIRA: FUNCTEST-480
Change-Id: Id5706de5f05d6841a1e9d8bafae7df0255c22a26
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/scripts/testcases_parser.py')
-rw-r--r-- | utils/test/scripts/testcases_parser.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/test/scripts/testcases_parser.py b/utils/test/scripts/testcases_parser.py new file mode 100644 index 000000000..cf9599858 --- /dev/null +++ b/utils/test/scripts/testcases_parser.py @@ -0,0 +1,24 @@ +import yaml + + +with open('./testcases.yaml') as f: + testcases_yaml = yaml.safe_load(f) +f.close() + + +def compose_format(fmt): + return 'format_' + fmt.strip() + + +def get_format(project, case): + testcases = testcases_yaml.get(project) + if isinstance(testcases, list): + for case_dict in testcases: + if case_dict['name'] == case: + return compose_format(case_dict['format']) + return None + + +if __name__ == '__main__': + fmt = get_format('functest', 'vping_ssh') + print fmt |