更新代码
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -82,6 +82,7 @@ def run_api_test(cases): | ... | @@ -82,6 +82,7 @@ def run_api_test(cases): |
| 82 | if not should_run_in_env(env_scope, current_env): | 82 | if not should_run_in_env(env_scope, current_env): |
| 83 | print(f"⏭️ 跳过用例 case_id: {case.get('case_id')},原因:不在{current_env}环境执行范围内 (env_scope: {env_scope})") | 83 | print(f"⏭️ 跳过用例 case_id: {case.get('case_id')},原因:不在{current_env}环境执行范围内 (env_scope: {env_scope})") |
| 84 | continue | 84 | continue |
| 85 | |||
| 85 | # 变量替换,优先用ip_host+path拼接url | 86 | # 变量替换,优先用ip_host+path拼接url |
| 86 | ip_host = replace_vars(case.get('ip_host', ''), env_vars) | 87 | ip_host = replace_vars(case.get('ip_host', ''), env_vars) |
| 87 | path = replace_vars(case.get('path', ''), env_vars) | 88 | path = replace_vars(case.get('path', ''), env_vars) |
| ... | @@ -98,7 +99,6 @@ def run_api_test(cases): | ... | @@ -98,7 +99,6 @@ def run_api_test(cases): |
| 98 | method = case.get('method', '').upper() | 99 | method = case.get('method', '').upper() |
| 99 | params_str = replace_vars(case.get('params', ''), env_vars) | 100 | params_str = replace_vars(case.get('params', ''), env_vars) |
| 100 | headers_str = replace_vars(case.get('headers', ''), env_vars) | 101 | headers_str = replace_vars(case.get('headers', ''), env_vars) |
| 101 | print(f"case_id: {case.get('case_id')}, headers_str: {headers_str}, env_vars: {env_vars}") | ||
| 102 | expected_code = int(case.get('expected_code', 0) or 0) | 102 | expected_code = int(case.get('expected_code', 0) or 0) |
| 103 | expected_msg = case.get('expected_msg', '') if 'expected_msg' in case else '' | 103 | expected_msg = case.get('expected_msg', '') if 'expected_msg' in case else '' |
| 104 | expected_response = replace_vars(case.get('expected_response', ''), env_vars) | 104 | expected_response = replace_vars(case.get('expected_response', ''), env_vars) | ... | ... |
-
Please register or sign in to post a comment