Skip to content

Commit

Permalink
更新测试用例retry参数的定义位置 (#115)
Browse files Browse the repository at this point in the history
* 更新测试用例retry参数的定义位置

* 更新schema和演示数据retry参数定义
  • Loading branch information
wu-clan authored Jan 27, 2024
1 parent 64b1b6f commit 32a48d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test_steps:
case_id: event_create_001
description: 测试hook
is_run:
retry: 2
request:
method: POST
url: /users/1
Expand All @@ -93,7 +94,6 @@ test_steps:
body: sum(a+b)=${sum_a_b(1,2)}; $test_cache; $test_env; ${test_global}.
userId: 1
files:
retry: 2
setup:
- hook: ${current_time()}
teardown:
Expand Down
2 changes: 1 addition & 1 deletion httpfpt/schemas/case_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ConfigRequestData(BaseModel):
verify: bool | None = None
redirects: bool | None = None
proxies: Dict[Literal['http', 'https', 'http://', 'https://'], AnyHttpUrl | None] | None = None
retry: int | None = None


class Config(BaseModel):
Expand Down Expand Up @@ -107,6 +106,7 @@ class Steps(BaseModel):
case_id: str
description: str
is_run: bool | dict | None = None
retry: int | None = None
request: StepsRequestData
setup: List[StepsSetUpData] | None = None
teardown: List[StepsTearDownData] | None = None
Expand Down
2 changes: 1 addition & 1 deletion httpfpt/utils/request/request_data_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def proxies(self) -> dict | None:
@property
def retry(self) -> int | None:
try:
retry = self.request_data['test_steps']['request']['retry']
retry = self.request_data['test_steps']['retry']
except _RequestDataParamGetError:
try:
retry = self.request_data['config']['request']['retry']
Expand Down

0 comments on commit 32a48d2

Please sign in to comment.