mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-10-24 00:54:44 +02:00
This change adds the OperationPolicyName attribute, extending support to the AttributeValueFactory. Test cases are included for the creation process for both the factory and the individual attribute.
86 lines
2.3 KiB
Python
86 lines
2.3 KiB
Python
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from testtools import TestCase
|
|
|
|
from kmip.core.attributes import OperationPolicyName
|
|
|
|
from kmip.core.utils import BytearrayStream
|
|
|
|
|
|
class TestNameValue(TestCase):
|
|
|
|
def setUp(self):
|
|
super(TestNameValue, self).setUp()
|
|
self.stream = BytearrayStream()
|
|
|
|
def tearDown(self):
|
|
super(TestNameValue, self).tearDown()
|
|
|
|
def test_write_no_padding(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_write_with_padding(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_read_no_padding(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_read_with_padding(self):
|
|
self.skip('Not implemented')
|
|
|
|
|
|
class TestName(TestCase):
|
|
|
|
def setUp(self):
|
|
super(TestName, self).setUp()
|
|
self.stream = BytearrayStream()
|
|
|
|
def tearDown(self):
|
|
super(TestName, self).tearDown()
|
|
|
|
def test_minimum_write(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_maximum_write(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_minimum_read(self):
|
|
self.skip('Not implemented')
|
|
|
|
def test_maximum_read(self):
|
|
self.skip('Not implemented')
|
|
|
|
|
|
class TestOperationPolicyName(TestCase):
|
|
|
|
def setUp(self):
|
|
super(TestOperationPolicyName, self).setUp()
|
|
|
|
def tearDown(self):
|
|
super(TestOperationPolicyName, self).tearDown()
|
|
|
|
def _test_operation_policy_name(self, value):
|
|
opn = OperationPolicyName(value)
|
|
|
|
msg = "expected {0}, received {1}".format(value, opn.value)
|
|
self.assertEqual(value, opn.value, msg)
|
|
|
|
def test_operation_policy_name(self):
|
|
self._test_operation_policy_name('test')
|
|
|
|
def test_operation_policy_name_on_none(self):
|
|
self._test_operation_policy_name(None)
|