Beispiel #1
0
 def test_decrypt_key_lt_0(self):
     """test decrypt key < 25"""
     self.assertEqual(
         decrypt_content("xyzabcdefghijklmnopqrstuvw", key=-3), ascii_lowercase
     )
Beispiel #2
0
 def test_decrypt_key_gt_25(self):
     """test decrypt key > 25"""
     self.assertEqual(
         decrypt_content("DEFGHIJKLMNOPQRSTUVWXYZABC", key=29), ascii_uppercase
     )
Beispiel #3
0
 def test_decrypt_rotation_lowercase_13(self):
     """test decrypt rotation lowercase -> k=13"""
     self.assertEqual(decrypt_content("nopqrstuvwxyzabcdefghijklm"), ascii_lowercase)
Beispiel #4
0
 def test_decrypt_non_ascii_letters_13(self):
     """test decrypt special chars like é, à, õ, ã, ç, etc... -> k=13"""
     content = punctuation + digits + whitespace + "àèáéíóúàãõâêîôûñ"
     self.assertEqual(decrypt_content(content), content)
Beispiel #5
0
 def test_decrypt_rotation_uppercase_13(self):
     """test decrypt rotation uppercase -> k=13"""
     self.assertEqual(decrypt_content("NOPQRSTUVWXYZABCDEFGHIJKLM"), ascii_uppercase)