コード例 #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_