예제 #1
0
 def test_caesar_encode1(self):
     self.assertEqual(Caesar().encode('itisawesomeprogramminginpython'),
                      'lwlvdzhvrphsurjudpplqjlqsbwkrq')
예제 #2
0
 def test_caesar_decode(self):
     self.assertEqual(Caesar().decode('yhqlylglylfl'), 'venividivici')
예제 #3
0
 def test_caesar_encode_with_numbers(self):
     self.assertEqual(Caesar().encode('1, 2, 3, Go!'), 'jr')
예제 #4
0
 def test_caesar_encode3(self):
     self.assertEqual(Caesar().encode('\'Twas the night before Christmas'),
                      'wzdvwkhqljkwehiruhfkulvwpdv')
예제 #5
0
 def test_caesar_encode2(self):
     self.assertEqual(Caesar().encode('venividivici'), 'yhqlylglylfl')
예제 #6
0
 def test_caesar_combo(self):
     text = 'venividivici'
     caesar = Caesar()
     cipher = caesar.encode(text)
     self.assertEqual(cipher, 'yhqlylglylfl')
     self.assertEqual(caesar.decode(cipher), text)