From cb550aef7a50c2e483a767c80cd563a539e42fbb Mon Sep 17 00:00:00 2001 From: Peter Hamilton Date: Fri, 24 Apr 2015 09:35:05 -0400 Subject: [PATCH] Fixing invalid tag for the KeyMaterialStruct --- kmip/core/objects.py | 2 +- kmip/tests/core/objects/test_objects.py | 26 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/kmip/core/objects.py b/kmip/core/objects.py index f1b8964..c23c182 100644 --- a/kmip/core/objects.py +++ b/kmip/core/objects.py @@ -442,7 +442,7 @@ class KeyMaterial(ByteString): class KeyMaterialStruct(Struct): def __init__(self): - super(KeyMaterialStruct, self).__init__(Tags.SERVER_INFORMATION) + super(KeyMaterialStruct, self).__init__(Tags.KEY_MATERIAL) self.data = BytearrayStream() diff --git a/kmip/tests/core/objects/test_objects.py b/kmip/tests/core/objects/test_objects.py index 63f6ae6..908f848 100644 --- a/kmip/tests/core/objects/test_objects.py +++ b/kmip/tests/core/objects/test_objects.py @@ -16,9 +16,35 @@ from six import string_types from testtools import TestCase +from kmip.core.enums import Tags + from kmip.core.objects import ExtensionName from kmip.core.objects import ExtensionTag from kmip.core.objects import ExtensionType +from kmip.core.objects import KeyMaterialStruct + + +class TestKeyMaterialStruct(TestCase): + """ + A test suite for the KeyMaterialStruct. + + A placeholder test suite. Should be removed when KeyMaterialStruct is + removed from the code base. + """ + + def setUp(self): + super(TestKeyMaterialStruct, self).setUp() + + def tearDown(self): + super(TestKeyMaterialStruct, self).tearDown() + + def test_valid_tag(self): + """ + Test that the KeyMaterialStruct tag is valid. + """ + struct = KeyMaterialStruct() + + self.assertEqual(Tags.KEY_MATERIAL, struct.tag) class TestExtensionName(TestCase):