def test_byte_make(n, expected): bits = [true if (n & (1 << i)) else false for i in xrange(8)] assert lib.byte_make(*bits) == expected
def test_byte_test(expected, bits): byte = lib.byte_make(*bits) assert reduce(lib.byte_test(byte)) == expected