diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2017-10-01 00:09:41 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-02-05 22:24:00 +0100 |
commit | 1b2d6bdc3adc19374e65e07c8cd33c6baa928017 (patch) | |
tree | 0173f6687e0cc6037c7eda14f0a501ba1cafc810 /tests | |
parent | 67c43a5136c6834542638d7a9be6f366ea696ad9 (diff) | |
download | m2crypto-1b2d6bdc3adc19374e65e07c8cd33c6baa928017.tar.gz |
Testing tests.test_bio.CipherStreamTestCase.test_ciphers
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_bio.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_bio.py b/tests/test_bio.py index c0c5bf0..f8460cf 100644 --- a/tests/test_bio.py +++ b/tests/test_bio.py @@ -9,6 +9,7 @@ Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2006 Open Source Applications Foundation Author: Heikki Toivonen """ +import logging try: import unittest2 as unittest except ImportError: @@ -18,6 +19,8 @@ from M2Crypto import BIO, Rand from tests.fips import fips_mode +log = logging.getLogger('test_bio') + class CipherStreamTestCase(unittest.TestCase): def try_algo(self, algo): data = b'123456789012345678901234' @@ -67,8 +70,17 @@ class CipherStreamTestCase(unittest.TestCase): 'rc4', 'rc2_40_cbc'] if not fips_mode: # Forbidden ciphers ciphers += nonfips_ciphers + + failed_ciphers = [] + log.debug('ciphers:\n%s', ciphers) for i in ciphers: - self.try_algo(i) + try: + self.try_algo(i) + except AssertionError: + failed_ciphers.append(i) + + self.assertEqual(len(failed_ciphers), 0, + "failed ciphers: %s" % ', '.join(failed_ciphers)) with self.assertRaises(ValueError): self.try_algo('nosuchalgo4567') |