License includes hash functions
[python-cryptoplus.git] / test / test_doctests.py
blobdcd1df261492c8bcd6379264eac9e48ddaf8c7ad
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,\
9 DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent,\
10 python_Rijndael, CAST, ARC2, python_PRESENT
11 from CryptoPlus.Util import padding
12 from CryptoPlus.Hash import python_RadioGatun, python_PBKDF2, RIPEMD, python_MD5,\
13 python_SHA,python_SHA256,python_SHA224,python_SHA384,python_SHA512,\
14 python_whirlpool
15 try:
16 from CryptoPlus.Cipher import IDEA
17 from CryptoPlus.Cipher import RC5
18 import_error = 0
19 except ImportError:
20 import_error = 1
22 suite = unittest.TestSuite()
23 #for mod in (CryptoPlus.Cipher.python_AES,CryptoPlus.Cipher.python_AES):
24 for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish,\
25 Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2,\
26 python_PRESENT, padding, python_RadioGatun, python_PBKDF2, RIPEMD,\
27 python_MD5, python_SHA,python_SHA256,python_SHA224,python_SHA384,python_SHA512,\
28 python_whirlpool:
29 suite.addTest(doctest.DocTestSuite(mod))
30 if not import_error:
31 suite.addTest(doctest.DocTestSuite(IDEA))
32 suite.addTest(doctest.DocTestSuite(RC5))
33 runner = unittest.TextTestRunner(verbosity=2)
34 runner.run(suite)