From 0c46f970fee4e1f7e3d5211a8b0b8c40790986f1 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Mon, 19 May 2014 12:15:21 -0400 Subject: [PATCH] Fix dogtag unit tests Recent changes have broken some of the Dogtag unit tests. This patch fixes the tests to be in line with the current plugin implementation. Change-Id: I0302f231ca8ab60caf2735d5950cb828ad3b4184 Closes-Bug: 1320934 --- barbican/tests/crypto/test_dogtag_crypto.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/barbican/tests/crypto/test_dogtag_crypto.py b/barbican/tests/crypto/test_dogtag_crypto.py index 571eca836..59a924b77 100644 --- a/barbican/tests/crypto/test_dogtag_crypto.py +++ b/barbican/tests/crypto/test_dogtag_crypto.py @@ -63,9 +63,9 @@ class WhenTestingDogtagCryptoPlugin(testtools.TestCase): secret.bit_length = 128 secret.algorithm = "AES" generate_dto = plugin_import.GenerateDTO( - plugin_import.PluginSupportTypes.SYMMETRIC_KEY_GENERATION, secret.algorithm, secret.bit_length, + None, None) self.plugin.generate_symmetric( generate_dto, @@ -136,9 +136,9 @@ class WhenTestingDogtagCryptoPlugin(testtools.TestCase): self.skipTest("Dogtag imports not available") payload = 'encrypt me!!' encrypt_dto = plugin_import.EncryptDTO(payload) - _cyphertext, _kek_meta_extended = self.plugin.encrypt(encrypt_dto, - mock.MagicMock(), - mock.MagicMock()) + self.plugin.encrypt(encrypt_dto, + mock.MagicMock(), + mock.MagicMock()) self.keyclient_mock.archive_key.assert_called_once_with( mock.ANY, "passPhrase", @@ -172,7 +172,8 @@ class WhenTestingDogtagCryptoPlugin(testtools.TestCase): self.skipTest("Dogtag imports not available") self.assertTrue( self.plugin.supports( - plugin_import.PluginSupportTypes.SYMMETRIC_KEY_GENERATION + plugin_import.PluginSupportTypes.SYMMETRIC_KEY_GENERATION, + 'aes', 256 ) )