Ejemplo n.º 1
0
 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 ')
Ejemplo n.º 2
0
 def test_perfect_square(self):
     self.assertEqual('ac bd', encode('ABCD'))
Ejemplo n.º 3
0
 def test_remove_spaces(self):
     self.assertEqual(encode('  b '), 'b')
Ejemplo n.º 4
0
 def test_9chars_results_3chunks(self):
     self.assertEqual(encode('This is fun!'), 'tsf hiu isn')
Ejemplo n.º 5
0
 def test_encode_decode(self):
     msg = 'tensioniswhoyouthinkyoushouldberelaxationiswhoyouare'
     self.assertEqual(msg, decode(encode(msg)))
Ejemplo n.º 6
0
 def test_perfect_square(self):
     self.assertEqual('wliod drwe', encode('WorldWide'))
Ejemplo n.º 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))
Ejemplo n.º 8
0
 def test_punctuation(self):
     msg = "1, 2, 3, Go! Go, for God's sake!"
     ciph = '1gga2 ook3f degos ors'
     self.assertEqual(ciph, encode(msg))
Ejemplo n.º 9
0
 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 '
     )
Ejemplo n.º 10
0
 def test_almost_perfect_square(self):
     self.assertEqual('oasny selde', encode('One day less'))
Ejemplo n.º 11
0
 def test_8chars_results_3chunks_ending_space(self):
     self.assertEqual(encode('Chill out.'), 'clu hlt io ')
Ejemplo n.º 12
0
 def test_9chars_results_3chunks(self):
     self.assertEqual(encode('This is fun!'), 'tsf hiu isn')
Ejemplo n.º 13
0
 def test_remove_punctuation(self):
     self.assertEqual(encode('@1,%!'), '1')
Ejemplo n.º 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))
Ejemplo n.º 15
0
 def test_encode_decode(self):
     msg = 'tensioniswhoyouthinkyoushouldberelaxationiswhoyouare'
     self.assertEqual(msg, decode(encode(msg)))
Ejemplo n.º 16
0
 def test_remove_spaces(self):
     self.assertEqual(encode('  b '), 'b')
Ejemplo n.º 17
0
 def test_empty_plain(self):
     self.assertEqual('', encode(''))
Ejemplo n.º 18
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))
Ejemplo n.º 19
0
 def test_perfect_square(self):
     self.assertEqual('wliod drwe', encode('WorldWide'))
Ejemplo n.º 20
0
 def test_empty_plain(self):
     self.assertEqual('', encode(''))
Ejemplo n.º 21
0
 def test_small_imperfect_square(self):
     self.assertEqual(encode('This is easy!'), 'tis hsy ie sa')
Ejemplo n.º 22
0
 def test_lowercase(self):
     self.assertEqual(encode('A'), 'a')
Ejemplo n.º 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)
Ejemplo n.º 24
0
 def test_remove_punctuation(self):
     self.assertEqual(encode('@1,%!'), '1')
Ejemplo n.º 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)
Ejemplo n.º 26
0
 def test_8chars_results_3chunks_ending_space(self):
     self.assertEqual(encode('Chill out.'), 'clu hlt io ')
Ejemplo n.º 27
0
 def test_empty_string(self):
     self.assertEqual(encode(''), '')
Ejemplo n.º 28
0
 def test_empty_string(self):
     self.assertEqual('', encode(''))
Ejemplo n.º 29
0
 def test_perfect_square(self):
     self.assertEqual(encode('ABCD'), 'ac bd')
Ejemplo n.º 30
0
 def test_small_imperfect_square(self):
     self.assertEqual('tis hsy ie sa', encode('This is easy!'))
Ejemplo n.º 31
0
 def test_almost_perfect_square(self):
     self.assertEqual('oasny selde', encode('One day less'))
Ejemplo n.º 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))
Ejemplo n.º 33
0
 def test_lowercase(self):
     self.assertEqual(encode('A'), 'a')