refactor: make testcase

This commit is contained in:
debugtalk
2020-05-18 15:55:38 +08:00
parent c9039535da
commit bd71a23843
5 changed files with 63 additions and 50 deletions

View File

@@ -7,14 +7,10 @@ from httprunner import exceptions, loader
class TestLoader(unittest.TestCase):
def test_load_testcase_file(self):
path = "examples/postman_echo/request_methods/request_with_variables.yml"
testcase_json, testcase_obj = loader.load_testcase_file(path)
self.assertEqual(
testcase_json["config"]["name"], "request methods testcase with variables"
)
testcase_obj = loader.load_testcase_file(path)
self.assertEqual(
testcase_obj.config.name, "request methods testcase with variables"
)
self.assertEqual(len(testcase_json["teststeps"]), 3)
self.assertEqual(len(testcase_obj.teststeps), 3)
def test_load_json_file_file_format_error(self):