e311921112b728a0dc453c61d59787d921f92d8d
[python-cryptoplus.git] / test / test_doctests.py
blobe311921112b728a0dc453c61d59787d921f92d8d
1 #!/usr/bin/env python
3 import unittest
4 import doctest
5 from pkg_resources import require
6 require("CryptoPlus>=1.0")
7 #import CryptoPlus.Cipher.python_AES
8 from CryptoPlus.Cipher import python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT
9 from CryptoPlus.Util import padding
10 try:
11 from CryptoPlus.Cipher import IDEA
12 from CryptoPlus.Cipher import RC5
13 import_error = 0
14 except ImportError:
15 import_error = 1
17 suite = unittest.TestSuite()
18 #for mod in (CryptoPlus.Cipher.python_AES,CryptoPlus.Cipher.python_AES):
19 for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT, padding:
20 suite.addTest(doctest.DocTestSuite(mod))
21 if not import_error:
22 suite.addTest(doctest.DocTestSuite(IDEA))
23 suite.addTest(doctest.DocTestSuite(RC5))
24 runner = unittest.TextTestRunner(verbosity=2)
25 runner.run(suite)