mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-15 12:27:59 +08:00
match_expected: add comparator str_len/string_length
This commit is contained in:
@@ -210,6 +210,8 @@ def match_expected(value, expected, comparator="eq"):
|
||||
assert value in expected
|
||||
elif comparator in ["regex"]:
|
||||
assert re.match(expected, value)
|
||||
elif comparator in ["str_len", "string_length"]:
|
||||
assert len(value) == int(expected)
|
||||
else:
|
||||
raise ParamsError("comparator not supported!")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user