2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-18 17:23:52 +00:00

Add the missing locate/activate KmipClient abstractmethod definition

This commit is contained in:
Hao Shen
2017-04-14 10:45:25 -07:00
parent 19560b92b7
commit ec4dae707c
2 changed files with 57 additions and 4 deletions

View File

@@ -35,17 +35,26 @@ class DummyKmipClient(api.KmipClient):
def register(self, managed_object, *args, **kwargs):
super(DummyKmipClient, self).register(managed_object)
def locate(self, maximum_items, storage_status_mask, object_group_member,
attributes):
super(DummyKmipClient, self).locate(
maximum_items, storage_status_mask, object_group_member,
attributes)
def get(self, uid, *args, **kwargs):
super(DummyKmipClient, self).get(uid)
def get_attribute_list(self, uid, *args, **kwargs):
super(DummyKmipClient, self).get_attribute_list(uid)
def activate(self, uid):
super(DummyKmipClient, self).activate(uid)
def destroy(self, uid):
super(DummyKmipClient, self).destroy(uid)
def mac(self, uid, algorithm, data):
super(DummyKmipClient, self).mac(uid, algorithm, data)
def mac(self, data, uid, algorithm):
super(DummyKmipClient, self).mac(data, uid, algorithm)
class TestKmipClient(testtools.TestCase):
@@ -89,6 +98,14 @@ class TestKmipClient(testtools.TestCase):
dummy = DummyKmipClient()
dummy.register('secret')
def test_locate(self):
"""
Test that the locate method can be called without error.
"""
dummy = DummyKmipClient()
dummy.locate('maximum_items', 'storage_status_mask',
'object_group_member', 'attributes')
def test_get(self):
"""
Test that the get method can be called without error.
@@ -103,6 +120,13 @@ class TestKmipClient(testtools.TestCase):
dummy = DummyKmipClient()
dummy.get_attribute_list('uid')
def test_activate(self):
"""
Test that the activate method can be called without error.
"""
dummy = DummyKmipClient()
dummy.activate('uid')
def test_destroy(self):
"""
Test that the destroy method can be called without error.