mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
TestRunner: add testcase suite writen in YAML
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
status_code: 201
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
body:
|
||||
success: true
|
||||
msg: user created successfully.
|
||||
|
||||
-
|
||||
name: create user which existed
|
||||
@@ -26,4 +29,7 @@
|
||||
response:
|
||||
status_code: 500
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
Content-Type: application/json
|
||||
body:
|
||||
success: false
|
||||
msg: user already existed.
|
||||
@@ -69,9 +69,16 @@ class TestUtils(ApiServerUnittest):
|
||||
}
|
||||
)
|
||||
|
||||
def test_run_testcase_suite_success(self):
|
||||
def test_run_testcase_suite_json_success(self):
|
||||
testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.json')
|
||||
testcases = utils.load_testcases(testcase_file_path)
|
||||
result = self.test_runner.run_testcase_suite(testcases)
|
||||
self.assertEqual(len(result), 2)
|
||||
self.assertEqual(result, [(True, {}), (True, {})])
|
||||
|
||||
def test_run_testcase_suite_yaml_success(self):
|
||||
testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.yml')
|
||||
testcases = utils.load_testcases(testcase_file_path)
|
||||
result = self.test_runner.run_testcase_suite(testcases)
|
||||
self.assertEqual(len(result), 2)
|
||||
self.assertEqual(result, [(True, {}), (True, {})])
|
||||
|
||||
Reference in New Issue
Block a user