refactor: rename TestSuiteSummary field details to testcases

This commit is contained in:
debugtalk
2020-04-23 17:49:38 +08:00
parent 4fc95aa261
commit 48bd79d049
3 changed files with 5 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ def __stringify_response(response_data):
def stringify_summary(testsuite_summary: TestSuiteSummary):
""" stringify summary, in order to dump json file and generate html report.
"""
for index, testcase_summary in enumerate(testsuite_summary.details):
for index, testcase_summary in enumerate(testsuite_summary.testcases):
if not testcase_summary.name:
testcase_summary.name = f"testcase {index}"

View File

@@ -142,7 +142,7 @@ class HttpRunner(object):
},
"time": {},
"platform": report.get_platform(),
"details": []
"testcases": []
}
for testcase_summary in tests_results:
@@ -153,7 +153,7 @@ class HttpRunner(object):
testsuite_summary["success"] &= testcase_summary.success
testsuite_summary["details"].append(testcase_summary)
testsuite_summary["testcases"].append(testcase_summary)
total_duration = tests_results[-1].time.start_at + tests_results[-1].time.duration \
- tests_results[0].time.start_at
@@ -233,7 +233,7 @@ class HttpRunner(object):
return [
testcase_summary.in_out.dict()
for testcase_summary in self._summary.details
for testcase_summary in self._summary.testcases
]
def run_path(self, path, dot_env_path=None, mapping=None) -> TestSuiteSummary:

View File

@@ -134,4 +134,4 @@ class TestSuiteSummary(BaseModel):
stat: Stat
time: TestCaseTime
platform: PlatformInfo
details: List[TestCaseSummary]
testcases: List[TestCaseSummary]