Esempio n. 1
0
def test_zfill_bits_to_int():
    bits = '1010'
    assert utils.bits_to_int(bits) == utils.bits_to_int(bits.zfill(10))
Esempio n. 2
0
def test_bits_to_int_large_numbers(bits, expected):
    assert utils.bits_to_int(bits) == expected
Esempio n. 3
0
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
Esempio n. 4
0
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_
Esempio n. 5
0
def test_bits_to_int():
    for bits, int_ in BITS_INT.items():
        assert utils.bits_to_int(bits) == int_