def test_binary_decryption(self): message_input = '01010011 01001111 01010011' message = main.decrypt(message_input, main.binary_dict) message_check = main.morbin(switch=False, message_test=message_input) self.assertEqual(message, message_check)
def test_morse_decryption(self): message_input = '... --- ...' message = main.decrypt(message_input, main.morse_code_dict) message_check = main.morbin(switch=True, message_test=message_input) self.assertEqual(message, message_check)
def test_morbin_encrypt_morse(self): message_input = 'SOS' message = main.morbin(switch=True, message_test=message_input) message_check = main.encrypt(message_input, main.morse_code_dict) self.assertEqual(message, message_check)
def test_morbin_invalid_message(self): message_input = '|||' with open(os.devnull, 'w') as f, contextlib.redirect_stdout(f): message = main.morbin(switch=True, message_test=message_input) message_check = main.end_message self.assertEqual(message, message_check)
def test_morbin_encrypt_binary(self): message_input = 'SOS' message = main.morbin(switch=False, message_test=message_input) message_check = main.encrypt(message_input, main.binary_dict) self.assertEqual(message, message_check)