rename function name, resolve conflict with unittest

This commit is contained in:
debugtalk
2017-11-02 13:32:51 +08:00
parent 6e65f5cf0c
commit 9d50b1635c
4 changed files with 16 additions and 16 deletions

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_tests(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_tests(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_tests(testcase_file_path)
testcases = testcase._load_file(testcase_file_path)
self.assertEqual(len(testcases), 3)
test = testcases[0]["test"]
self.assertIn('name', test)
@@ -41,7 +41,7 @@ class TestcaseParserUnittest(unittest.TestCase):
f.write("")
with self.assertRaises(FileFormatError):
testcase.load_yaml_file(yaml_tmp_file)
testcase._load_yaml_file(yaml_tmp_file)
os.remove(yaml_tmp_file)
@@ -50,7 +50,7 @@ class TestcaseParserUnittest(unittest.TestCase):
f.write("abc")
with self.assertRaises(FileFormatError):
testcase.load_yaml_file(yaml_tmp_file)
testcase._load_yaml_file(yaml_tmp_file)
os.remove(yaml_tmp_file)
@@ -61,7 +61,7 @@ class TestcaseParserUnittest(unittest.TestCase):
f.write("")
with self.assertRaises(FileFormatError):
testcase.load_json_file(json_tmp_file)
testcase._load_json_file(json_tmp_file)
os.remove(json_tmp_file)
@@ -70,7 +70,7 @@ class TestcaseParserUnittest(unittest.TestCase):
f.write("{}")
with self.assertRaises(FileFormatError):
testcase.load_json_file(json_tmp_file)
testcase._load_json_file(json_tmp_file)
os.remove(json_tmp_file)
@@ -79,7 +79,7 @@ class TestcaseParserUnittest(unittest.TestCase):
f.write("abc")
with self.assertRaises(FileFormatError):
testcase.load_json_file(json_tmp_file)
testcase._load_json_file(json_tmp_file)
os.remove(json_tmp_file)