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 ')
Example #2
0
 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'))
Example #7
0
 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 '
     )
Example #10
0
 def test_almost_perfect_square(self):
     self.assertEqual('oasny selde', encode('One day less'))
Example #11
0
 def test_8chars_results_3chunks_ending_space(self):
     self.assertEqual(encode('Chill out.'), 'clu hlt io ')
Example #12
0
 def test_9chars_results_3chunks(self):
     self.assertEqual(encode('This is fun!'), 'tsf hiu isn')
Example #13
0
 def test_remove_punctuation(self):
     self.assertEqual(encode('@1,%!'), '1')
Example #14
0
 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))
Example #15
0
 def test_encode_decode(self):
     msg = 'tensioniswhoyouthinkyoushouldberelaxationiswhoyouare'
     self.assertEqual(msg, decode(encode(msg)))
Example #16
0
 def test_remove_spaces(self):
     self.assertEqual(encode('  b '), 'b')
Example #17
0
 def test_empty_plain(self):
     self.assertEqual('', encode(''))
 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))
Example #19
0
 def test_perfect_square(self):
     self.assertEqual('wliod drwe', encode('WorldWide'))
 def test_empty_plain(self):
     self.assertEqual('', encode(''))
Example #21
0
 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')
Example #23
0
 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_remove_punctuation(self):
     self.assertEqual(encode('@1,%!'), '1')
Example #25
0
 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_8chars_results_3chunks_ending_space(self):
     self.assertEqual(encode('Chill out.'), 'clu hlt io ')
Example #27
0
 def test_empty_string(self):
     self.assertEqual(encode(''), '')
Example #28
0
 def test_empty_string(self):
     self.assertEqual('', encode(''))
Example #29
0
 def test_perfect_square(self):
     self.assertEqual(encode('ABCD'), 'ac bd')
Example #30
0
 def test_small_imperfect_square(self):
     self.assertEqual('tis hsy ie sa', encode('This is easy!'))
 def test_almost_perfect_square(self):
     self.assertEqual('oasny selde', encode('One day less'))
Example #32
0
 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))
Example #33
0
 def test_lowercase(self):
     self.assertEqual(encode('A'), 'a')