run_testset: add variables_mapping parameter

This commit is contained in:
httprunner
2017-09-19 17:07:07 +08:00
parent 1b847d562d
commit 041152c00f
2 changed files with 52 additions and 20 deletions

View File

@@ -119,3 +119,14 @@ class TestRunner(ApiServerUnittest):
result = self.test_runner.run_testset(testsets[0])
self.assertTrue(result["success"])
self.assertIn("token", result["output"])
def test_run_testset_with_variables_mapping(self):
testcase_file_path = os.path.join(
os.getcwd(), 'tests/data/demo_testset_layer.yml')
testsets = load_testcases_by_path(testcase_file_path)
variables_mapping = {
"app_version": '2.9.7'
}
result = self.test_runner.run_testset(testsets[0], variables_mapping)
self.assertTrue(result["success"])
self.assertIn("token", result["output"])