call HttpRunner class with testsets data structure other than path

This commit is contained in:
httprunner
2018-04-17 21:41:02 +08:00
parent efaf4365b2
commit a92f382571
5 changed files with 233 additions and 27 deletions

View File

@@ -738,3 +738,32 @@ class TestcaseParserUnittest(unittest.TestCase):
{"var3": "val3"},
merged_extractors
)
def test_is_testsets(self):
data_structure = "path/to/file"
self.assertFalse(testcase.is_testsets(data_structure))
data_structure = ["path/to/file1", "path/to/file2"]
self.assertFalse(testcase.is_testsets(data_structure))
data_structure = {
"name": "desc1",
"config": {},
"api": {},
"testcases": ["testcase11", "testcase12"]
}
self.assertTrue(data_structure)
data_structure = [
{
"name": "desc1",
"config": {},
"api": {},
"testcases": ["testcase11", "testcase12"]
},
{
"name": "desc2",
"config": {},
"api": {},
"testcases": ["testcase21", "testcase22"]
}
]
self.assertTrue(data_structure)