def test_clear(self): ''' Test that the clear bit operation is correct ''' barray = BitArray(array=[0xFF]) for pos in [0, 1, 4]: barray.clear(pos) self.assertEqual([0xEC], barray.to_byte_list()) barray = BitArray(array=[0x13]) for pos in [0, 1, 4]: barray.clear(pos) self.assertEqual([0x00], barray.to_byte_list())