コード例 #1
0
 def test_decode_numbers(self):
     self.assertEqual(decode("odpoz ub123 odpoz ub", 25, 7),
                      "testing123testing")
コード例 #2
0
 def test_decode_exercism(self):
     self.assertEqual(decode("tytgn fjr", 3, 7), "exercism")
コード例 #3
0
 def test_decode_sentence(self):
     self.assertEqual(
         decode("qdwju nqcro muwhn odqun oppmd aunwd o", 19, 16),
         "anobstacleisoftenasteppingstone")
コード例 #4
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_with_too_many_spaces(self):
     self.assertEqual(
         decode("vszzm    cly   yd cg    qdp", 15, 16), "jollygreengiant")
コード例 #5
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_raises_meaningful_exception(self):
     with self.assertRaisesWithMessage(ValueError):
         decode("Test", 13, 5)
コード例 #6
0
 def test_decode_with_too_many_spaces(self):
     self.assertEqual(decode("vszzm    cly   yd cg    qdp", 15, 16),
                      "jollygreengiant")
コード例 #7
0
 def test_decode_all_the_letters2(self):
     self.assertEqual(
         decode("kqlfd jzvgy tpaet icdhm rtwly kqlon ubstx", 19, 13),
         "thequickbrownfoxjumpsoverthelazydog",
     )
コード例 #8
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_sentence(self):
     self.assertEqual(
         decode("qdwju nqcro muwhn odqun oppmd aunwd o", 19, 16),
         "anobstacleisoftenasteppingstone")
コード例 #9
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_numbers(self):
     self.assertEqual(decode("odpoz ub123 odpoz ub", 25, 7),
                      "testing123testing")
コード例 #10
0
ファイル: affine_cipher_test.py プロジェクト: rvsp/python-1
 def test_decode_with_a_not_coprime_to_m(self):
     with self.assertRaisesWithMessage(ValueError):
         decode("Test", 13, 5)
コード例 #11
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_exercism(self):
     self.assertEqual(decode("tytgn fjr", 3, 7), "exercism")
コード例 #12
0
 def test_decode_test(self):
     self.assertEqual(decode("ybty", 5, 7), "test")
コード例 #13
0
 def test_decode_with_a_not_coprime_to_m_2(self):
     with self.assertRaisesWithMessage(ValueError):
         decode("ybty", 18, 13)
コード例 #14
0
 def test_decode_with_no_spaces_in_input2(self):
     self.assertEqual(
         decode("AnObstacleIsOftenASteppingStone", 23, 31),
         "tgxknetbyjznxaejgtnejoozgrnexgj",
     )
コード例 #15
0
 def test_decode_all_the_letters(self):
     self.assertEqual(
         decode("swxtj npvyk lruol iejdc blaxk swxmh qzglf", 17, 33),
         "thequickbrownfoxjumpsoverthelazydog")
コード例 #16
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_all_the_letters(self):
     self.assertEqual(
         decode("swxtj npvyk lruol iejdc blaxk swxmh qzglf", 17, 33),
         "thequickbrownfoxjumpsoverthelazydog")
コード例 #17
0
 def test_decode_with_no_spaces(self):
     self.assertEqual(decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33),
                      "thequickbrownfoxjumpsoverthelazydog")
コード例 #18
0
ファイル: affine_cipher_test.py プロジェクト: fortrieb/python
 def test_decode_with_no_spaces(self):
     self.assertEqual(
         decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33),
         "thequickbrownfoxjumpsoverthelazydog")
コード例 #19
0
 def test_decode_raises_meaningful_exception(self):
     with self.assertRaisesWithMessage(ValueError):
         decode("Test", 13, 5)
コード例 #20
0
 def test_decode_with_a_not_coprime_to_m(self):
     with self.assertRaises(ValueError) as err:
         decode("Test", 13, 5)
     self.assertEqual(type(err.exception), ValueError)
     self.assertEqual(err.exception.args[0], "a and m must be coprime.")