def test_54chars_results_7chunks_2ending_space(self): self.assertEqual( encode('If man was meant to stay on the ground, ' 'god would have given us roots.'), 'imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau ')
def test_perfect_square(self): self.assertEqual('ac bd', encode('ABCD'))
def test_remove_spaces(self): self.assertEqual(encode(' b '), 'b')
def test_9chars_results_3chunks(self): self.assertEqual(encode('This is fun!'), 'tsf hiu isn')
def test_encode_decode(self): msg = 'tensioniswhoyouthinkyoushouldberelaxationiswhoyouare' self.assertEqual(msg, decode(encode(msg)))
def test_perfect_square(self): self.assertEqual('wliod drwe', encode('WorldWide'))
def test_long_string(self): msg = "Be who you are and say what you feel, because those who mind "\ "don't matter and those who matter don't mind." ciph = 'betcw tttne ayahm htdwn ouoao ehdus mtsro sfeit edyae tnewo '\ 'oyehd rhnuw lodao tahbs onmmr aeend ai' self.assertEqual(ciph, encode(msg))
def test_punctuation(self): msg = "1, 2, 3, Go! Go, for God's sake!" ciph = '1gga2 ook3f degos ors' self.assertEqual(ciph, encode(msg))
def test_54chars_results_7chunks_2ending_space(self): self.assertEqual( encode('If man was meant to stay on the ground, ' 'god would have given us roots.'), 'imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau ' )
def test_almost_perfect_square(self): self.assertEqual('oasny selde', encode('One day less'))
def test_8chars_results_3chunks_ending_space(self): self.assertEqual(encode('Chill out.'), 'clu hlt io ')
def test_remove_punctuation(self): self.assertEqual(encode('@1,%!'), '1')
def test_punctuation_and_numbers(self): msg = "1, 2, 3, Go! Go, for God's sake!" ciph = '1gga 2ook 3fde gos ors' self.assertEqual(ciph, encode(msg))
def test_empty_plain(self): self.assertEqual('', encode(''))
def test_small_imperfect_square(self): self.assertEqual(encode('This is easy!'), 'tis hsy ie sa')
def test_lowercase(self): self.assertEqual(encode('A'), 'a')
def test_punctuation_and_numbers(self): msg = "1, 2, 3, Go! Go, for God's sake!" ciph = '1gga 2ook 3fde gos ors' self.assertEqual(encode(msg), ciph)
def test_long_string(self): msg = ("If man was meant to stay on the ground, god would have given " "us roots.") ciph = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau" self.assertEqual(encode(msg), ciph)
def test_empty_string(self): self.assertEqual(encode(''), '')
def test_empty_string(self): self.assertEqual('', encode(''))
def test_perfect_square(self): self.assertEqual(encode('ABCD'), 'ac bd')
def test_small_imperfect_square(self): self.assertEqual('tis hsy ie sa', encode('This is easy!'))
def test_long_string(self): msg = ("If man was meant to stay on the ground, god would have given " "us roots.") ciph = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau" self.assertEqual(ciph, encode(msg))