-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 添加测试用例mark动态标记 * 提交动态mark逻辑代码 * 修复运行参数格式化 * 修复ids代码版本兼容性
- Loading branch information
Showing
10 changed files
with
128 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ test_steps: | |
is_run: | ||
skip: True | ||
reason: 自定义跳过 | ||
mark: | ||
- test_api | ||
request: | ||
method: GET | ||
url: /skip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
from __future__ import annotations | ||
|
||
from httpfpt.common.errors import RequestDataParseError | ||
|
||
|
||
def get_ids(request_data: list) -> list: | ||
def get_ids(request_data: dict | list) -> list: | ||
""" | ||
从请求数据获取数据驱动下的 ids 数据 | ||
:param request_data: 请求数据 | ||
:return: | ||
""" | ||
ids = [] | ||
for data in request_data: | ||
try: | ||
module = data['config']['module'] | ||
name = data['test_steps']['name'] | ||
case_id = data['test_steps']['case_id'] | ||
except KeyError as e: | ||
raise RequestDataParseError('测试用例 ids 获取失败, 请检查测试用例数据是否符合规范: {}'.format(e)) | ||
ids.append('module: {}, name: {}, case_id: {}'.format(module, name, case_id)) | ||
try: | ||
if isinstance(request_data, dict): | ||
module = request_data['config']['module'] | ||
case_id = request_data['test_steps']['case_id'] | ||
ids.append(f'module: {module}, case_id: {case_id}') | ||
else: | ||
for data in request_data: | ||
module = data['config']['module'] | ||
case_id = data['test_steps']['case_id'] | ||
ids.append(f'module: {module}, case_id: {case_id}') | ||
except KeyError as e: | ||
raise RequestDataParseError('测试用例 ids 获取失败, 请检查测试用例数据是否符合规范: {}'.format(e)) | ||
return ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters