コード例 #1
0
    def test_quote_from_bertrand_russel_on_rationality(self):
        src_exp = [
            ("The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts.",
             "tbwfaaneeo hlootyosof eeroisfapd wmllcstnlo hwdssohdeu oiiaacewsb ltsnremiot ehtderssfs pthfateeu  rhaalalrl  oetnwivpl "),
            ("Men are born ignorant, not stupid. They are made stupid by education.",
             "mrnpruu entiepc nindmia agotadt rnthdbi eoseeyo brtysen oauatd "
            ),
            ("The fact that an opinion has been widely held is no evidence whatever that it is not utterly absurd; indeed in view of the silliness of the majority of mankind, a widely spread belief is more likely to be foolish than sensible.",
             "tpivrtesmialie hiditeeiandis  enedhrdljdbkh  filealiloaeet  aoyntynirwllh  cnhciavniiiya  theetbietdetn  talwisesyefos  hsdhsuwsolibe  abianroofysen  testodffmsmfs  aenetittapooi  nnovunhhnrrob  oweetdeekeell "),
            ("It Has Been Said That Man Is A Rational Animal. All My Life I Have Been Searching For Evidence Which Could Support This.",
             "iailmehdcr tisaybieot hdanlennut atriiegclh shamfnfedi bataesowss etilierhu  emoahaeip  nanlarvcp  snalvciho ")
        ]

        for src, exp in src_exp:
            self.assertEqual(cipher_text(src), exp)
コード例 #2
0
 def test_remove_spaces(self):
     value = "  b "
     expected = "b"
     self.assertEqual(cipher_text(value), expected)
コード例 #3
0
 def test_lowercase(self):
     value = "A"
     expected = "a"
     self.assertEqual(cipher_text(value), expected)
コード例 #4
0
 def test_empty_string(self):
     self.assertEqual(cipher_text(''), '')
コード例 #5
0
 def test_remove_spaces(self):
     self.assertEqual(cipher_text('  b '), 'b')
コード例 #6
0
 def test_8_character_plaintext_results_in_3_chunks_the_last_one_with_a_trailing_space(
     self
 ):
     value = "Chill out."
     expected = "clu hlt io "
     self.assertEqual(cipher_text(value), expected)
コード例 #7
0
 def test_zombies(self):
     value = "ZOMG! ZOMBIES!!!"
     expected = "zzi ooe mms gb "
     self.assertEqual(cipher_text(value), expected)
コード例 #8
0
 def test_lowercase(self):
     self.assertEqual(cipher_text('A'), 'a')
コード例 #9
0
 def test_remove_spaces(self):
     self.assertEqual(cipher_text('  b '), 'b')
コード例 #10
0
 def test_54chars_results_7chunks_2ending_space(self):
     self.assertEqual(
         cipher_text('If man was meant to stay on the ground, '
                     'god would have given us roots.'),
         'imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau '
     )
コード例 #11
0
 def test_empty_string(self):
     self.assertEqual(cipher_text(''), '')
コード例 #12
0
 def test_8chars_results_3chunks_ending_space(self):
     self.assertEqual(cipher_text('Chill out.'), 'clu hlt io ')
コード例 #13
0
 def test_9chars_results_3chunks(self):
     self.assertEqual(cipher_text('This is fun!'), 'tsf hiu isn')
コード例 #14
0
 def test_remove_punctuation(self):
     self.assertEqual(cipher_text('@1,%!'), '1')
コード例 #15
0
 def test_remove_punctuation(self):
     value = "@1,%!"
     expected = "1"
     self.assertEqual(cipher_text(value), expected)
コード例 #16
0
 def test_remove_punctuation(self):
     self.assertEqual(cipher_text('@1,%!'), '1')
コード例 #17
0
 def test_9_character_plaintext_results_in_3_chunks_of_3_characters(self):
     value = "This is fun!"
     expected = "tsf hiu isn"
     self.assertEqual(cipher_text(value), expected)
コード例 #18
0
 def test_9chars_results_3chunks(self):
     self.assertEqual(cipher_text('This is fun!'), 'tsf hiu isn')
コード例 #19
0
 def test_54_character_plaintext_results_in_7_chunks_the_last_two_with_trailing_spaces(
     self
 ):
     value = "If man was meant to stay on the ground, god would have given us roots."
     expected = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau "
     self.assertEqual(cipher_text(value), expected)
コード例 #20
0
 def test_8chars_results_3chunks_ending_space(self):
     self.assertEqual(cipher_text('Chill out.'), 'clu hlt io ')
コード例 #21
0
 def test_nvre_vex(self):
     value = "Never vex thine heart with idle woes"
     expected = "neewl exhie vtetw ehaho ririe vntds"
     self.assertEqual(cipher_text(value), expected)
コード例 #22
0
 def test_54chars_results_7chunks_2ending_space(self):
     self.assertEqual(
         cipher_text('If man was meant to stay on the ground, '
                     'god would have given us roots.'),
         'imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau ')
コード例 #23
0
 def test_empty_plaintext_results_in_an_empty_ciphertext(self):
     value = ""
     expected = ""
     self.assertEqual(cipher_text(value), expected)
コード例 #24
0
 def test_lowercase(self):
     self.assertEqual(cipher_text('A'), 'a')