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
This commit is contained in:
Ade Lee 2014-05-19 12:15:21 -04:00
parent 309665cb41
commit 0c46f970fe
1 changed files with 6 additions and 5 deletions

View File

@ -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
)
)