def test_sliceTestFail(self): testWord = bitstring.BitArray("0x00000000000F0000") testWord.reverse() result = BitSlice.slice(testWord, 0, 2) assert result.uint == bitstring.BitArray("0x0").uint , "slice somehow returned the correct result ({})".format(result)
def test_sliceTestPass(self): testWord = bitstring.Bits("0x0000000000FF0000") result = BitSlice.slice(testWord, 8, 16) assert result.int == bitstring.Bits("0x0FF").int , "slice is pulling the wrong bits ({}, {})".format(result.int, bitstring.Bits("0x0FF").int)