PBKDF2: added doctest
[python-cryptoplus.git] / test / test_doctests.py
bloba42e4de8e88cf69b94f04817faf72fd82ae25faf
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
13 try:
14 from CryptoPlus.Cipher import IDEA
15 from CryptoPlus.Cipher import RC5
16 import_error = 0
17 except ImportError:
18 import_error = 1
20 suite = unittest.TestSuite()
21 #for mod in (CryptoPlus.Cipher.python_AES,CryptoPlus.Cipher.python_AES):
22 for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish,\
23 Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2,\
24 python_PRESENT, padding, python_RadioGatun, python_PBKDF2:
25 suite.addTest(doctest.DocTestSuite(mod))
26 if not import_error:
27 suite.addTest(doctest.DocTestSuite(IDEA))
28 suite.addTest(doctest.DocTestSuite(RC5))
29 runner = unittest.TextTestRunner(verbosity=2)
30 runner.run(suite)