mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-19 08:19:29 +08:00
0.9.5:
1, remove PyUnitReport dependency; 2, add built-in html report; 3, support pass in html report template, in Jinja2 format.
This commit is contained in:
@@ -78,50 +78,50 @@ class TestRunner(ApiServerUnittest):
|
||||
def test_run_testset_hardcode(self):
|
||||
for testcase_file_path in self.testcase_file_path_list:
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testsets_hardcode(self):
|
||||
result = HttpRunner(self.testcase_file_path_list).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertEqual(result.stat.total, 6)
|
||||
self.assertEqual(result.stat.successes, 6)
|
||||
self.assertTrue(result["success"])
|
||||
self.assertEqual(result["stat"]["testsRun"], 6)
|
||||
self.assertEqual(result["stat"]["successes"], 6)
|
||||
|
||||
def test_run_testset_template_variables(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_variables.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testset_template_import_functions(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_template_import_functions.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testsets_template_import_functions(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_template_import_functions.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testsets_template_lambda_functions(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_template_lambda_functions.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testset_layered(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_layer.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertTrue(result["success"])
|
||||
|
||||
def test_run_testset_output(self):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_testset_layer.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertIn("token", result.output)
|
||||
self.assertTrue(result["success"])
|
||||
self.assertIn("token", result["output"])
|
||||
|
||||
def test_run_testset_with_variables_mapping(self):
|
||||
testcase_file_path = os.path.join(
|
||||
@@ -129,9 +129,9 @@ class TestRunner(ApiServerUnittest):
|
||||
variables_mapping = {
|
||||
"app_version": '2.9.7'
|
||||
}
|
||||
result = HttpRunner(testcase_file_path).run(variables_mapping)
|
||||
self.assertTrue(result.success)
|
||||
self.assertIn("token", result.output)
|
||||
result = HttpRunner(testcase_file_path).run(mapping=variables_mapping)
|
||||
self.assertTrue(result["success"])
|
||||
self.assertIn("token", result["output"])
|
||||
|
||||
def test_run_testcase_with_empty_header(self):
|
||||
testcase_file_path = os.path.join(
|
||||
@@ -162,6 +162,6 @@ class TestRunner(ApiServerUnittest):
|
||||
testcase_file_path = os.path.join(
|
||||
os.getcwd(), 'tests/data/demo_parameters.yml')
|
||||
result = HttpRunner(testcase_file_path).run()
|
||||
self.assertTrue(result.success)
|
||||
self.assertIn("token", result.output)
|
||||
self.assertEqual(result.stat.total, 6)
|
||||
self.assertTrue(result["success"])
|
||||
self.assertIn("token", result["output"])
|
||||
self.assertEqual(result["stat"]["testsRun"], 6)
|
||||
|
||||
Reference in New Issue
Block a user