def test_invalid_bit_inversion(self): try: Signal._invert_bit_index(0, 16) except BitInversionError: pass else: self.fail("")
def test_bit_inversion(self): eq_(Signal._invert_bit_index(24, 16), 16) eq_(Signal._invert_bit_index(48, 1), 55) eq_(Signal._invert_bit_index(8, 16), 0)