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