コード例 #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
ファイル: crypto_square_test.py プロジェクト: ebiven/exercism
 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
ファイル: crypto_square_test.py プロジェクト: ebiven/exercism
 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
ファイル: crypto_square_test.py プロジェクト: ebiven/exercism
 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
ファイル: crypto_square_test.py プロジェクト: ebiven/exercism
 def test_empty_string(self):
     self.assertEqual(encode(''), '')
コード例 #28
0
 def test_empty_string(self):
     self.assertEqual('', encode(''))
コード例 #29
0
ファイル: crypto_square_test.py プロジェクト: ebiven/exercism
 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')