mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-16 19:17:36 +08:00
make variables in testcase template compatible with mapping style:
new mapping style:
"variables": {
"a": 1,
"b": 2
}
Also, the former list style is still valid:
"variables": [
{"a": 1},
{"b": 2}
]
This commit is contained in:
@@ -419,7 +419,7 @@ class TestApi(ApiServerUnittest):
|
||||
self.assertEqual(len(testcase_tests), 2)
|
||||
self.assertIn("api", testcase_tests[0])
|
||||
self.assertEqual(testcase_tests[0]["name"], "get token (setup)")
|
||||
self.assertIsInstance(testcase_tests[0]["variables"], list)
|
||||
self.assertIsInstance(testcase_tests[0]["variables"], dict)
|
||||
self.assertIn("api_def", testcase_tests[0])
|
||||
self.assertEqual(testcase_tests[0]["api_def"]["request"]["url"], "/api/get-token")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user