mirror of https://github.com/OpenKMIP/PyKMIP.git
Merge pull request #411 from OpenKMIP/bug/fix-client-crypto-params
Fix a client bug for cryptographic parameter handling
This commit is contained in:
commit
fdfbba8a0e
|
@ -1243,12 +1243,15 @@ class ProxyKmipClient(object):
|
|||
CryptographicParameters struct.
|
||||
|
||||
Returns:
|
||||
None: if value is None
|
||||
CryptographicParameters: a CryptographicParameters struct
|
||||
|
||||
Raises:
|
||||
TypeError: if the input argument is invalid
|
||||
"""
|
||||
if not isinstance(value, dict):
|
||||
if value is None:
|
||||
return None
|
||||
elif not isinstance(value, dict):
|
||||
raise TypeError("Cryptographic parameters must be a dictionary.")
|
||||
|
||||
cryptographic_parameters = CryptographicParameters(
|
||||
|
|
|
@ -2600,6 +2600,15 @@ class TestProxyKmipClient(testtools.TestCase):
|
|||
self.assertRaises(
|
||||
ClientConnectionNotOpen, client.locate, *args)
|
||||
|
||||
def test_build_cryptographic_parameters_with_none(self):
|
||||
"""
|
||||
Test that an empty set of cryptographic parameters is processed
|
||||
correctly.
|
||||
"""
|
||||
client = ProxyKmipClient()
|
||||
result = client._build_cryptographic_parameters(None)
|
||||
self.assertEqual(None, result)
|
||||
|
||||
def test_build_cryptographic_parameters_invalid(self):
|
||||
"""
|
||||
Test that the right error is raised when attempting to build
|
||||
|
|
Loading…
Reference in New Issue