def test_coder_decoder(self): "coder and decoder should work properly" for mesg in ( '01110111', '110111', '011001111', '011110010111', ): code = correction.hamming_coder(mesg) self.assertEqual(correction.hamming_decoder(code), mesg)
def test_decoder_returns_empty_string_with_more_than_1_errors(self): for code in ( '01010', ): self.assertEqual(correction.hamming_decoder(code), '')