import caesar1 import unittest class KnownEncryptions(unittest.TestCase): known_encryptions = ( ('hello', 2, 'jgnnq'), ('plain', 5, 'uqfns'), ('abcde', 1, 'bcdef'), ('zoo', 4, 'dss'), ('xylophone', 14, 'lmzcdvcbs')) def test_caesar_known_encryptions(self): '''encrypt should give known result with known input''' for plaintext, shift, ciphertext in self.known_encryptions: result = caesar1.encrypt(plaintext, shift) self.assertEqual(result, ciphertext) if __name__ == '__main__': unittest.main()