mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-29 03:57:22 +08:00
update unittest
This commit is contained in:
@@ -348,13 +348,13 @@ class TestParser(unittest.TestCase):
|
|||||||
def test_substitute_variables(self):
|
def test_substitute_variables(self):
|
||||||
content = {
|
content = {
|
||||||
'request': {
|
'request': {
|
||||||
'url': '/api/users/$uid',
|
'url': '/api/users/$uid?id=$id',
|
||||||
'headers': {'token': '$token'}
|
'headers': {'token': '$token'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variables_mapping = {"$uid": 1000}
|
variables_mapping = {"$uid": 1000, "$id": 2}
|
||||||
substituted_data = parser.substitute_variables(content, variables_mapping)
|
substituted_data = parser.substitute_variables(content, variables_mapping)
|
||||||
self.assertEqual(substituted_data["request"]["url"], "/api/users/1000")
|
self.assertEqual(substituted_data["request"]["url"], "/api/users/1000?id=2")
|
||||||
self.assertEqual(substituted_data["request"]["headers"], {'token': '$token'})
|
self.assertEqual(substituted_data["request"]["headers"], {'token': '$token'})
|
||||||
|
|
||||||
def test_parse_parameters_raw_list(self):
|
def test_parse_parameters_raw_list(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user