refactor: is_test_content

This commit is contained in:
debugtalk
2020-01-01 23:19:29 +08:00
parent 48bde0dda8
commit e9ca45de5f
5 changed files with 98 additions and 122 deletions

View File

@@ -7,9 +7,9 @@ class TestLoaderCheck(unittest.TestCase):
def test_is_testcases(self):
data_structure = "path/to/file"
self.assertFalse(check.is_testcases(data_structure))
self.assertFalse(check.is_test_content(data_structure))
data_structure = ["path/to/file1", "path/to/file2"]
self.assertFalse(check.is_testcases(data_structure))
self.assertFalse(check.is_test_content(data_structure))
data_structure = {
"project_mapping": {
@@ -29,9 +29,12 @@ class TestLoaderCheck(unittest.TestCase):
{
'name': 'test step desc1',
'variables': [], # optional
'extract': [], # optional
'extract': {}, # optional
'validate': [],
'request': {}
'request': {
"method": "GET",
"url": "https://docs.httprunner.org"
}
},
# test_dict2 # another test dict
]
@@ -39,19 +42,4 @@ class TestLoaderCheck(unittest.TestCase):
# testcase_dict_2 # another testcase dict
]
}
self.assertTrue(check.is_testcases(data_structure))
data_structure = [
{
"name": "desc1",
"config": {},
"api": {},
"testcases": ["testcase11", "testcase12"]
},
{
"name": "desc2",
"config": {},
"api": {},
"testcases": ["testcase21", "testcase22"]
}
]
self.assertTrue(data_structure)
self.assertTrue(check.is_test_content(data_structure))