记录一下断言源码便于断言
def get_uniform_comparator(comparator): """ convert comparator alias to uniform name """ if comparator in ["eq", "equals", "==", "is"]: ##等于 return "equals" elif comparator in ["lt", "less_than"]: ##小于 return "less_than" elif comparator in ["le", "less_than_or_equals"]: ##小于等于 return "less_than_or_equals" elif comparator in ["gt", "greater_than"]: ##大于 return "greater_than" elif comparator in ["ge", "greater_than_or_equals"]: ##大于等于 return "greater_than_or_equals" elif comparator in ["ne", "not_equals"]: ##不等于 return "not_equals" elif comparator in ["str_eq", "string_equals"]: ##字符串相等 return "string_equals" elif comparator in ["len_eq", "length_equals", "count_eq"]: ##长度相等 return "length_equals" elif comparator in ["len_gt", "count_gt", "length_greater_than", "count_greater_than"]: ##长度大于 return "length_greater_than" elif comparator in ["len_ge", "count_ge", "length_greater_than_or_equals", ##长度大于等于 "count_greater_than_or_equals"]: return "length_greater_than_or_equals" elif comparator in ["len_lt", "count_lt", "length_less_than", "count_less_than"]: ##长度小于 return "length_less_than" elif comparator in ["len_le", "count_le", "length_less_than_or_equals", ##长度小于等于 "count_less_than_or_equals"]: return "length_less_than_or_equals" else: return comparator ##自定义