mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-14 06:57:35 +08:00
refactor: change function name to avoid conflict with unittest loader
This commit is contained in:
@@ -333,7 +333,7 @@ class TestHttpRunner(ApiServerUnittest):
|
||||
]
|
||||
|
||||
tests_mapping = {
|
||||
"project_mapping": loader.load_project_tests("tests"),
|
||||
"project_mapping": loader.load_project_data("tests"),
|
||||
"testcases": testcases
|
||||
}
|
||||
summary = self.runner.run_tests(tests_mapping)
|
||||
@@ -364,7 +364,7 @@ class TestHttpRunner(ApiServerUnittest):
|
||||
}
|
||||
]
|
||||
tests_mapping = {
|
||||
"project_mapping": loader.load_project_tests("tests"),
|
||||
"project_mapping": loader.load_project_data("tests"),
|
||||
"testcases": testcases
|
||||
}
|
||||
summary = self.runner.run_tests(tests_mapping)
|
||||
@@ -393,7 +393,7 @@ class TestHttpRunner(ApiServerUnittest):
|
||||
}
|
||||
]
|
||||
tests_mapping = {
|
||||
"project_mapping": loader.load_project_tests("tests"),
|
||||
"project_mapping": loader.load_project_data("tests"),
|
||||
"testcases": testcases
|
||||
}
|
||||
summary = self.runner.run_tests(tests_mapping)
|
||||
@@ -602,7 +602,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testcase_loader(self):
|
||||
testcase_path = "tests/testcases/setup.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
project_mapping = tests_mapping["project_mapping"]
|
||||
self.assertIsInstance(project_mapping, dict)
|
||||
@@ -627,7 +627,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testcase_parser(self):
|
||||
testcase_path = "tests/testcases/setup.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
parsed_testcases = parser.parse_tests(tests_mapping)
|
||||
|
||||
@@ -648,7 +648,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testcase_add_tests(self):
|
||||
testcase_path = "tests/testcases/setup.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
runner = HttpRunner()
|
||||
@@ -662,7 +662,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testcase_complex_verify(self):
|
||||
testcase_path = "tests/testcases/create_user.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
teststeps = testcases[0]["teststeps"]
|
||||
|
||||
@@ -679,7 +679,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testcase_simple_run_suite(self):
|
||||
testcase_path = "tests/testcases/setup.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
runner = HttpRunner()
|
||||
test_suite = runner._add_tests(testcases)
|
||||
@@ -693,7 +693,7 @@ class TestApi(ApiServerUnittest):
|
||||
"tests/testcases/create_user.json",
|
||||
"tests/testcases/create_user.v2.json"
|
||||
]:
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
runner = HttpRunner()
|
||||
test_suite = runner._add_tests(testcases)
|
||||
@@ -712,7 +712,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testsuite_loader(self):
|
||||
testcase_path = "tests/testsuites/create_users.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
project_mapping = tests_mapping["project_mapping"]
|
||||
self.assertIsInstance(project_mapping, dict)
|
||||
@@ -744,7 +744,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testsuite_parser(self):
|
||||
testcase_path = "tests/testsuites/create_users.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
parsed_testcases = parser.parse_tests(tests_mapping)
|
||||
self.assertEqual(len(parsed_testcases), 2)
|
||||
@@ -762,7 +762,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testsuite_add_tests(self):
|
||||
testcase_path = "tests/testsuites/create_users.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
runner = HttpRunner()
|
||||
@@ -774,7 +774,7 @@ class TestApi(ApiServerUnittest):
|
||||
|
||||
def test_testsuite_run_suite(self):
|
||||
testcase_path = "tests/testsuites/create_users.yml"
|
||||
tests_mapping = loader.load_tests(testcase_path)
|
||||
tests_mapping = loader.load_cases(testcase_path)
|
||||
|
||||
testcases = parser.parse_tests(tests_mapping)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user