def test_bit_errors_no_errors(self):
     bits = 10
     transmit = np.zeros(bits)
     receive = np.zeros(bits)
     bit_count, bit_errors = dc.bit_errors(transmit, receive)
     self.assertEqual(bit_count, bits)
     self.assertEqual(bit_errors, 0)
 def test_bit_errors_five_errors(self):
     """
     Test for 5 bit errors. Uses ones for data alignment.
     :return:
     """
     bits = 100
     transmit = np.ones(bits)
     receive = np.ones(bits)
     rand_bits = [80, 75, 59, 3, 7]
     for rand_bit in rand_bits:
         receive[rand_bit] -= 1
     bit_count, bit_errors = dc.bit_errors(transmit, receive)
     self.assertEqual(bit_count, bits)
     self.assertEqual(bit_errors, len(rand_bits))