Merge pull request #10 from OpenKMIP/bug/fix-key-material-tag

Fixing invalid tag for the KeyMaterialStruct
This commit is contained in:
Peter Hamilton 2015-04-29 16:05:45 -04:00
commit 883a36f22a
2 changed files with 27 additions and 1 deletions

View File

@ -442,7 +442,7 @@ class KeyMaterial(ByteString):
class KeyMaterialStruct(Struct): class KeyMaterialStruct(Struct):
def __init__(self): def __init__(self):
super(KeyMaterialStruct, self).__init__(Tags.SERVER_INFORMATION) super(KeyMaterialStruct, self).__init__(Tags.KEY_MATERIAL)
self.data = BytearrayStream() self.data = BytearrayStream()

View File

@ -16,9 +16,35 @@
from six import string_types from six import string_types
from testtools import TestCase from testtools import TestCase
from kmip.core.enums import Tags
from kmip.core.objects import ExtensionName from kmip.core.objects import ExtensionName
from kmip.core.objects import ExtensionTag from kmip.core.objects import ExtensionTag
from kmip.core.objects import ExtensionType 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): class TestExtensionName(TestCase):