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