change: rename schema model name and class name

This commit is contained in:
debugtalk
2020-05-14 23:53:18 +08:00
parent 9a9594b0c1
commit 98f4a8f065
10 changed files with 59 additions and 58 deletions

View File

@@ -9,26 +9,27 @@ from httprunner.new_loader import load_testcase_file, load_folder_files
__TMPL__ = """# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
import unittest
from httprunner.runner import TestCaseRunner
from httprunner.schema import TestsConfig, TestStep
from httprunner.runner import HttpRunner
from httprunner.schema import TConfig, TStep
class {{ class_name }}(unittest.TestCase):
config = TestsConfig(**{{ config }})
config = TConfig(**{{ config }})
teststeps = [
{% for teststep in teststeps %}
TestStep(**{{ teststep }}),
TStep(**{{ teststep }}),
{% endfor %}
]
def test_start(self):
TestCaseRunner(self.config, self.teststeps).run()
HttpRunner(self.config, self.teststeps).run()
"""
def make_testcase(testcase_path: str) -> str:
logger.info(f"start to make testcase: {testcase_path}")
testcase, _ = load_testcase_file(testcase_path)
template = jinja2.Template(__TMPL__)