Exemple #1
0
    def test_encrypt_decrypt_sentence_with_punctuation(self):
        self.plaintext = cipher.PlaintextMessage('Cat, dog@,  .', 19)
        encrypted_text = self.plaintext.get_message_text_encrypted()

        self.ciphertext = cipher.CiphertextMessage(encrypted_text)
        self.assertEqual(self.ciphertext.decrypt_message(),
                         (7, 'Cat, dog@,  .'))
Exemple #2
0
 def test_descrypt_msg_shift10(self):
     self.ciphertext = cipher.CiphertextMessage("sxysaud")
     self.assertEqual(self.ciphertext.decrypt_message(), (10, "chicken"))
Exemple #3
0
 def test_descrypt_msg_shift8(self):
     self.ciphertext = cipher.CiphertextMessage("xslzwj")
     self.assertEqual(self.ciphertext.decrypt_message(), (8, "father"))
Exemple #4
0
 def test_descrypt_msg_shift6(self):
     self.ciphertext = cipher.CiphertextMessage("giomy")
     self.assertEqual(self.ciphertext.decrypt_message(), (6, "mouse"))
Exemple #5
0
 def test_descrypt_msg_shift4(self):
     self.ciphertext = cipher.CiphertextMessage("jkjoajoa")
     self.assertEqual(self.ciphertext.decrypt_message(), (4, "nonsense"))
Exemple #6
0
 def test_descrypt_msg_shift2(self):
     self.ciphertext = cipher.CiphertextMessage("pybgm")
     self.assertEqual(self.ciphertext.decrypt_message(), (2, "radio"))
Exemple #7
0
 def test_descrypt_msg_with_capital_letters(self):
     self.ciphertext = cipher.CiphertextMessage("GiOmY")
     self.assertEqual(self.ciphertext.decrypt_message(), (6, "MoUsE"))
Exemple #8
0
 def test_descrypt_msg_with_number(self):
     self.ciphertext = cipher.CiphertextMessage("hgriute 10")
     self.assertEqual(self.ciphertext.decrypt_message(), (20, "balcony 10"))
Exemple #9
0
 def test_descrypt_msg_shift22(self):
     self.ciphertext = cipher.CiphertextMessage("nierw")
     self.assertEqual(self.ciphertext.decrypt_message(), (22, "jeans"))
Exemple #10
0
 def test_descrypt_msg_shift24(self):
     self.ciphertext = cipher.CiphertextMessage("wpkxgtukva")
     self.assertEqual(self.ciphertext.decrypt_message(), (24, "university"))
Exemple #11
0
 def test_descrypt_msg_shift20(self):
     self.ciphertext = cipher.CiphertextMessage("hgriute")
     self.assertEqual(self.ciphertext.decrypt_message(), (20, "balcony"))
Exemple #12
0
 def test_descrypt_msg_shift18(self):
     self.ciphertext = cipher.CiphertextMessage("aqabmz")
     self.assertEqual(self.ciphertext.decrypt_message(), (18, "sister"))
Exemple #13
0
 def test_descrypt_msg_shift16(self):
     self.ciphertext = cipher.CiphertextMessage("mrksb")
     self.assertEqual(self.ciphertext.decrypt_message(), (16, "chair"))
Exemple #14
0
 def test_descrypt_msg_shift14(self):
     self.ciphertext = cipher.CiphertextMessage("oaybgfqd")
     self.assertEqual(self.ciphertext.decrypt_message(), (14, "computer"))
Exemple #15
0
 def test_descrypt_msg_shift12(self):
     self.ciphertext = cipher.CiphertextMessage("ghfok")
     self.assertEqual(self.ciphertext.decrypt_message(), (12, "straw"))