Httprunner的validate
V3支持如下:
例如:"eq", "equals", "equal"等都可以表示equal
"lt", "less_than"都代表less_than
def get_uniform_comparator(comparator: Text): """ convert comparator alias to uniform name """ if comparator in ["eq", "equals", "equal"]: return "equal" elif comparator in ["lt", "less_than"]: return "less_than" elif comparator in ["le", "less_or_equals"]: return "less_or_equals" elif comparator in ["gt", "greater_than"]: return "greater_than" elif comparator in ["ge", "greater_or_equals"]: return "greater_or_equals" elif comparator in ["ne", "not_equal"]: return "not_equal" elif comparator in ["str_eq", "string_equals"]: return "string_equals" elif comparator in ["len_eq", "length_equal"]: return "length_equal" elif comparator in [ "len_gt", "length_greater_than", ]: return "length_greater_than" elif comparator in [ "len_ge", "length_greater_or_equals", ]: return "length_greater_or_equals" elif comparator in ["len_lt", "length_less_than"]: return "length_less_than" elif comparator in [ "len_le", "length_less_or_equals", ]: return "length_less_or_equals" else: return comparator
type_math 验证类型