mirror of
https://github.com/openkmip/pykmip
synced 2025-12-26 05:03:37 +00:00
Update the Create payloads
This change updates the Create payloads to the current payload format, adding properties for different payload attributes and adding comparison and string operators. Changes are also made to the PyKMIP clients and the surrounding testing infrastructure to reflect the payload changes. An official unit test suite for the Create payloads has also been included, which will eventually replace the existing Create message tests elsewhere in the test suite. This change prepares the Create payloads for future updates to support KMIP 2.0.
This commit is contained in:
committed by
Peter Hamilton
parent
a58a3a3bea
commit
30d7773d96
@@ -2395,7 +2395,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
attribute_factory = factory.AttributeFactory()
|
||||
|
||||
# Build Create request
|
||||
object_type = attributes.ObjectType(enums.ObjectType.SYMMETRIC_KEY)
|
||||
object_type = enums.ObjectType.SYMMETRIC_KEY
|
||||
template_attribute = objects.TemplateAttribute(
|
||||
attributes=[
|
||||
attribute_factory.create_attribute(
|
||||
@@ -2439,7 +2439,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
"Processing operation: Create"
|
||||
)
|
||||
|
||||
uid = response_payload.unique_identifier.value
|
||||
uid = response_payload.unique_identifier
|
||||
self.assertEqual('1', uid)
|
||||
|
||||
# Retrieve the stored object and verify all attributes were set
|
||||
@@ -2487,7 +2487,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
e._data_session = e._data_store_session_factory()
|
||||
e._logger = mock.MagicMock()
|
||||
|
||||
object_type = attributes.ObjectType(enums.ObjectType.PUBLIC_KEY)
|
||||
object_type = enums.ObjectType.PUBLIC_KEY
|
||||
payload = payloads.CreateRequestPayload(
|
||||
object_type
|
||||
)
|
||||
@@ -2520,7 +2520,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
attribute_factory = factory.AttributeFactory()
|
||||
|
||||
# Test the error for omitting the Cryptographic Algorithm
|
||||
object_type = attributes.ObjectType(enums.ObjectType.SYMMETRIC_KEY)
|
||||
object_type = enums.ObjectType.SYMMETRIC_KEY
|
||||
template_attribute = objects.TemplateAttribute(
|
||||
attributes=[
|
||||
attribute_factory.create_attribute(
|
||||
@@ -2566,7 +2566,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
e._logger.reset_mock()
|
||||
|
||||
# Test the error for omitting the Cryptographic Length
|
||||
object_type = attributes.ObjectType(enums.ObjectType.SYMMETRIC_KEY)
|
||||
object_type = enums.ObjectType.SYMMETRIC_KEY
|
||||
template_attribute = objects.TemplateAttribute(
|
||||
attributes=[
|
||||
attribute_factory.create_attribute(
|
||||
@@ -2612,7 +2612,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
e._logger.reset_mock()
|
||||
|
||||
# Test the error for omitting the Cryptographic Usage Mask
|
||||
object_type = attributes.ObjectType(enums.ObjectType.SYMMETRIC_KEY)
|
||||
object_type = enums.ObjectType.SYMMETRIC_KEY
|
||||
template_attribute = objects.TemplateAttribute(
|
||||
attributes=[
|
||||
attribute_factory.create_attribute(
|
||||
@@ -8000,7 +8000,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
attribute_factory = factory.AttributeFactory()
|
||||
|
||||
# Build a SymmetricKey for registration.
|
||||
object_type = attributes.ObjectType(enums.ObjectType.SYMMETRIC_KEY)
|
||||
object_type = enums.ObjectType.SYMMETRIC_KEY
|
||||
template_attribute = objects.TemplateAttribute(
|
||||
attributes=[
|
||||
attribute_factory.create_attribute(
|
||||
@@ -8042,7 +8042,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||
"Processing operation: Create"
|
||||
)
|
||||
|
||||
uid = response_payload.unique_identifier.value
|
||||
uid = response_payload.unique_identifier
|
||||
self.assertEqual('1', uid)
|
||||
|
||||
e._logger.reset_mock()
|
||||
|
||||
Reference in New Issue
Block a user