def test_zfill_bits_to_int(): bits = '1010' assert utils.bits_to_int(bits) == utils.bits_to_int(bits.zfill(10))
def test_bits_to_int_large_numbers(bits, expected): assert utils.bits_to_int(bits) == expected
def test_bits_to_int_and_back(): for bits in BITS_INT.keys(): int_ = utils.bits_to_int(bits) assert utils.int_to_bits(int_).zfill(len(bits)) == bits
def test_int_to_bits_and_back(): for int_ in BITS_INT.values(): bits = utils.int_to_bits(int_) assert utils.bits_to_int(bits) == int_
def test_bits_to_int(): for bits, int_ in BITS_INT.items(): assert utils.bits_to_int(bits) == int_