def test_length_calc_1(): a, b = length_calc(-6482, 325, True, 2) assert a == -6482 assert b == 325 try: a, b = length_calc(-32768, 32768, True, 2) assert False except ValueError: assert True a, b = length_calc(None, None, False, 4) assert a == 0 assert b == 4294967295 a, b = length_calc(None, None, True, 4) assert a == -2147483648 assert b == 2147483647
def __init__(self, length=None, min_length=None, max_length=None, null=True, default=None, db=True, label=None, placeholder=None, readonly=False, prefix=None, suffix=None, columns=None, hidden=False, enum=[], on_update=None, password=False, signed=True): try: min_length, max_length = length_calc(min_length, max_length, signed, 4) except ValueError as e: self.error(e) super().__init__(length=None, min_length=min_length, max_length=max_length, null=True, default=None, db=True, label=None, placeholder=None, readonly=False, prefix=None, suffix=None, columns=None, hidden=False, enum=[], on_update=None, password=False)