def test_create_symmetric_key_with_cryptographic_failure(self):
        # Create a dummy algorithm that always fails on instantiation.
        class DummyAlgorithm(object):
            key_sizes = [0]

            def __init__(self, key_bytes):
                raise Exception()

        engine = crypto.CryptographyEngine()
        engine._symmetric_key_algorithms.update([(
            enums.CryptographicAlgorithm.AES,
            DummyAlgorithm
        )])

        args = [enums.CryptographicAlgorithm.AES, 0]
        self.assertRaises(
            exceptions.CryptographicFailure,
            engine.create_symmetric_key,
            *args
        )
Test that a CryptographicFailure error is raised when the symmetric
dataset/ETHPy150Open OpenKMIP/PyKMIP/kmip/tests/unit/services/server/crypto/test_engine.py/TestCryptographyEngine.test_create_symmetric_key_with_cryptographic_failure