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