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