rename function

This commit is contained in:
httprunner
2018-02-14 22:05:11 +08:00
parent 8aa25023a3
commit 1db17cbd47
4 changed files with 12 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ class VariableBindsUnittest(ApiServerUnittest):
def setUp(self):
self.context = Context()
testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo_binds.yml')
self.testcases = testcase._load_file(testcase_file_path)
self.testcases = testcase.load_file(testcase_file_path)
def test_context_init_functions(self):
self.assertIn("get_timestamp", self.context.testset_functions_config)

View File

@@ -26,7 +26,7 @@ class TestRunner(ApiServerUnittest):
def test_run_single_testcase(self):
for testcase_file_path in self.testcase_file_path_list:
testcases = testcase._load_file(testcase_file_path)
testcases = testcase.load_file(testcase_file_path)
config_dict = {
"path": testcase_file_path
@@ -150,7 +150,7 @@ class TestRunner(ApiServerUnittest):
def test_bugfix_type_match(self):
testcase_file_path = os.path.join(
os.getcwd(), 'tests/data/test_bugfix.yml')
testcases = testcase._load_file(testcase_file_path)
testcases = testcase.load_file(testcase_file_path)
config_dict = {
"path": testcase_file_path
}

View File

@@ -10,12 +10,12 @@ class TestcaseParserUnittest(unittest.TestCase):
def test_load_testcases_bad_filepath(self):
testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo')
self.assertEqual(testcase._load_file(testcase_file_path), [])
self.assertEqual(testcase.load_file(testcase_file_path), [])
def test_load_json_testcases(self):
testcase_file_path = os.path.join(
os.getcwd(), 'tests/data/demo_testset_hardcode.json')
testcases = testcase._load_file(testcase_file_path)
testcases = testcase.load_file(testcase_file_path)
self.assertEqual(len(testcases), 3)
test = testcases[0]["test"]
self.assertIn('name', test)
@@ -26,7 +26,7 @@ class TestcaseParserUnittest(unittest.TestCase):
def test_load_yaml_testcases(self):
testcase_file_path = os.path.join(
os.getcwd(), 'tests/data/demo_testset_hardcode.yml')
testcases = testcase._load_file(testcase_file_path)
testcases = testcase.load_file(testcase_file_path)
self.assertEqual(len(testcases), 3)
test = testcases[0]["test"]
self.assertIn('name', test)