def get_timestamp(str_len=13): """ get timestamp string, length can only between 0 and 16 """ if isinstance(str_len, integer_types) and 0 < str_len < 17: return builtin_str(time.time()).replace(".", "")[:str_len] raise ParamsError("timestamp length can only between 0 and 16.")
def startswith(check_value, expect_value): assert builtin_str(check_value).startswith(builtin_str(expect_value))
def endswith(check_value, expect_value): assert builtin_str(check_value).endswith(builtin_str(expect_value))
def string_equals(check_value, expect_value): assert builtin_str(check_value) == builtin_str(expect_value)