Example #1
0
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.")
Example #2
0
def startswith(check_value, expect_value):
    assert builtin_str(check_value).startswith(builtin_str(expect_value))
Example #3
0
def endswith(check_value, expect_value):
    assert builtin_str(check_value).endswith(builtin_str(expect_value))
Example #4
0
def string_equals(check_value, expect_value):
    assert builtin_str(check_value) == builtin_str(expect_value)