mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-18 01:47:35 +08:00
bugfix: when a variable binds to None, it should not raise exception
This commit is contained in:
@@ -58,7 +58,8 @@ class TestcaseParserUnittest(unittest.TestCase):
|
||||
"var_2": "def",
|
||||
"var_3": 123,
|
||||
"var_4": {"a": 1},
|
||||
"var_5": True
|
||||
"var_5": True,
|
||||
"var_6": None
|
||||
}
|
||||
self.assertEqual(
|
||||
testcase.parse_variables("$var_1", variable_mapping),
|
||||
@@ -104,6 +105,10 @@ class TestcaseParserUnittest(unittest.TestCase):
|
||||
testcase.parse_variables("abc$var_4", variable_mapping),
|
||||
"abc{'a': 1}"
|
||||
)
|
||||
self.assertEqual(
|
||||
testcase.parse_variables("$var_6", variable_mapping),
|
||||
None
|
||||
)
|
||||
|
||||
def test_is_functon(self):
|
||||
self.assertTrue(testcase.is_functon("${func()}"))
|
||||
|
||||
Reference in New Issue
Block a user