evaluate testcase name

This commit is contained in:
debugtalk
2018-02-16 00:48:14 +08:00
parent 56cf359810
commit 182fbb6aeb
2 changed files with 8 additions and 2 deletions

View File

@@ -168,6 +168,11 @@ class Runner(object):
return True
def get_eval_content(self, content):
""" evaluate content with variable bindings
"""
return self.context.testcase_parser.parse_content_with_bindings(content)
def extract_output(self, output_variables_list):
""" extract output variables
"""

View File

@@ -72,10 +72,11 @@ class ApiTestSuite(unittest.TestSuite):
def _add_tests_to_suite(self, testcases):
for testcase_dict in testcases:
testcase_name = self.test_runner.get_eval_content(testcase_dict["name"])
if utils.PYTHON_VERSION == 3:
ApiTestCase.runTest.__doc__ = testcase_dict['name']
ApiTestCase.runTest.__doc__ = testcase_name
else:
ApiTestCase.runTest.__func__.__doc__ = testcase_dict['name']
ApiTestCase.runTest.__func__.__doc__ = testcase_name
test = ApiTestCase(self.test_runner, testcase_dict)
[self.addTest(test) for _ in range(int(testcase_dict.get("times", 1)))]