mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-19 17:59:34 +08:00
refactor: is_test_content
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user