mirror of https://github.com/OpenKMIP/PyKMIP.git
commit
bbc2d8e58a
|
@ -833,7 +833,7 @@ class TestProxyKmipClient(testtools.TestCase):
|
||||||
result = client.get_attribute_list(uid)
|
result = client.get_attribute_list(uid)
|
||||||
client.proxy.get_attribute_list.assert_called_with(uid)
|
client.proxy.get_attribute_list.assert_called_with(uid)
|
||||||
self.assertIsInstance(result, list)
|
self.assertIsInstance(result, list)
|
||||||
self.assertItemsEqual(attribute_names, result)
|
six.assertCountEqual(self, attribute_names, result)
|
||||||
|
|
||||||
@mock.patch('kmip.pie.client.KMIPProxy',
|
@mock.patch('kmip.pie.client.KMIPProxy',
|
||||||
mock.MagicMock(spec_set=KMIPProxy))
|
mock.MagicMock(spec_set=KMIPProxy))
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import six
|
||||||
import mock
|
import mock
|
||||||
import shutil
|
import shutil
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
|
@ -347,7 +348,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = "DiscoverVersions is not supported by KMIP {0}".format(
|
regex = "DiscoverVersions is not supported by KMIP {0}".format(
|
||||||
e._protocol_version
|
e._protocol_version
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.OperationNotSupported,
|
exceptions.OperationNotSupported,
|
||||||
regex,
|
regex,
|
||||||
e._process_discover_versions,
|
e._process_discover_versions,
|
||||||
|
@ -455,7 +457,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = "KMIP {0} is not supported by the server.".format(
|
regex = "KMIP {0} is not supported by the server.".format(
|
||||||
protocol
|
protocol
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
regex,
|
regex,
|
||||||
e.process_request,
|
e.process_request,
|
||||||
|
@ -481,7 +484,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (request, )
|
args = (request, )
|
||||||
regex = "Stale request rejected by server."
|
regex = "Stale request rejected by server."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
regex,
|
regex,
|
||||||
e.process_request,
|
e.process_request,
|
||||||
|
@ -513,7 +517,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (request, )
|
args = (request, )
|
||||||
regex = "Future request rejected by server."
|
regex = "Future request rejected by server."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
regex,
|
regex,
|
||||||
e.process_request,
|
e.process_request,
|
||||||
|
@ -545,7 +550,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (request, )
|
args = (request, )
|
||||||
regex = "Asynchronous operations are not supported."
|
regex = "Asynchronous operations are not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
regex,
|
regex,
|
||||||
e.process_request,
|
e.process_request,
|
||||||
|
@ -574,7 +580,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (request, )
|
args = (request, )
|
||||||
regex = "Undo option for batch handling is not supported."
|
regex = "Undo option for batch handling is not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
regex,
|
regex,
|
||||||
e.process_request,
|
e.process_request,
|
||||||
|
@ -741,7 +748,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
])
|
])
|
||||||
|
|
||||||
args = (batch, None, None)
|
args = (batch, None, None)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidMessage,
|
exceptions.InvalidMessage,
|
||||||
"Batch item ID is undefined.",
|
"Batch item ID is undefined.",
|
||||||
e._process_batch,
|
e._process_batch,
|
||||||
|
@ -912,7 +920,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = "{0} operation is not supported by the server.".format(
|
regex = "{0} operation is not supported by the server.".format(
|
||||||
args[0].name.title()
|
args[0].name.title()
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.OperationNotSupported,
|
exceptions.OperationNotSupported,
|
||||||
regex,
|
regex,
|
||||||
e._process_operation,
|
e._process_operation,
|
||||||
|
@ -956,7 +965,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = ('1', )
|
args = ('1', )
|
||||||
regex = "Could not locate object: 1"
|
regex = "Could not locate object: 1"
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._get_object_type,
|
e._get_object_type,
|
||||||
|
@ -1021,7 +1031,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._get_object_type,
|
e._get_object_type,
|
||||||
|
@ -1166,7 +1177,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (None, )
|
args = (None, )
|
||||||
regex = "Cannot build an unsupported object type."
|
regex = "Cannot build an unsupported object type."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._build_core_object,
|
e._build_core_object,
|
||||||
|
@ -1179,7 +1191,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (DummyObject(), )
|
args = (DummyObject(), )
|
||||||
regex = "The SplitKey object type is not supported."
|
regex = "The SplitKey object type is not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._build_core_object,
|
e._build_core_object,
|
||||||
|
@ -1272,7 +1285,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (template_attribute, )
|
args = (template_attribute, )
|
||||||
regex = "Attribute templates are not supported."
|
regex = "Attribute templates are not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_template_attribute,
|
e._process_template_attribute,
|
||||||
|
@ -1292,7 +1306,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (template_attribute, )
|
args = (template_attribute, )
|
||||||
regex = "The invalid attribute is unsupported."
|
regex = "The invalid attribute is unsupported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_template_attribute,
|
e._process_template_attribute,
|
||||||
|
@ -1321,7 +1336,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (template_attribute, )
|
args = (template_attribute, )
|
||||||
regex = "Attribute index missing from multivalued attribute."
|
regex = "Attribute index missing from multivalued attribute."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_template_attribute,
|
e._process_template_attribute,
|
||||||
|
@ -1338,7 +1354,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (template_attribute, )
|
args = (template_attribute, )
|
||||||
regex = "Non-zero attribute index found for single-valued attribute."
|
regex = "Non-zero attribute index found for single-valued attribute."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_template_attribute,
|
e._process_template_attribute,
|
||||||
|
@ -1365,7 +1382,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"Cannot set multiple instances of the Cryptographic Algorithm "
|
"Cannot set multiple instances of the Cryptographic Algorithm "
|
||||||
"attribute."
|
"attribute."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.IndexOutOfBounds,
|
exceptions.IndexOutOfBounds,
|
||||||
regex,
|
regex,
|
||||||
e._process_template_attribute,
|
e._process_template_attribute,
|
||||||
|
@ -1835,7 +1853,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"Cannot set Cryptographic Usage Mask attribute on OpaqueData "
|
"Cannot set Cryptographic Usage Mask attribute on OpaqueData "
|
||||||
"object."
|
"object."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._set_attributes_on_managed_object,
|
e._set_attributes_on_managed_object,
|
||||||
|
@ -1969,7 +1988,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
('Name', [name_a.attribute_value, name_b.attribute_value])
|
('Name', [name_a.attribute_value, name_b.attribute_value])
|
||||||
)
|
)
|
||||||
regex = "Cannot set duplicate name values."
|
regex = "Cannot set duplicate name values."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._set_attribute_on_managed_object,
|
e._set_attribute_on_managed_object,
|
||||||
|
@ -1998,7 +2018,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
('Digest', [name_a.attribute_value, name_b.attribute_value])
|
('Digest', [name_a.attribute_value, name_b.attribute_value])
|
||||||
)
|
)
|
||||||
regex = "The Digest attribute is unsupported."
|
regex = "The Digest attribute is unsupported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._set_attribute_on_managed_object,
|
e._set_attribute_on_managed_object,
|
||||||
|
@ -2016,7 +2037,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
('Cryptographic Length', length.attribute_value)
|
('Cryptographic Length', length.attribute_value)
|
||||||
)
|
)
|
||||||
regex = "Cannot overwrite the Cryptographic Length attribute."
|
regex = "Cannot overwrite the Cryptographic Length attribute."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._set_attribute_on_managed_object,
|
e._set_attribute_on_managed_object,
|
||||||
|
@ -2034,7 +2056,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
('Object Group', object_group.attribute_value)
|
('Object Group', object_group.attribute_value)
|
||||||
)
|
)
|
||||||
regex = "The Object Group attribute is unsupported."
|
regex = "The Object Group attribute is unsupported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._set_attribute_on_managed_object,
|
e._set_attribute_on_managed_object,
|
||||||
|
@ -2389,7 +2412,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Cannot create a PublicKey object with the Create operation."
|
regex = "Cannot create a PublicKey object with the Create operation."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create,
|
e._process_create,
|
||||||
|
@ -2446,7 +2470,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = (
|
regex = (
|
||||||
"The cryptographic algorithm must be specified as an attribute."
|
"The cryptographic algorithm must be specified as an attribute."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create,
|
e._process_create,
|
||||||
|
@ -2491,7 +2516,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = (
|
regex = (
|
||||||
"The cryptographic length must be specified as an attribute."
|
"The cryptographic length must be specified as an attribute."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create,
|
e._process_create,
|
||||||
|
@ -2533,7 +2559,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = (
|
regex = (
|
||||||
"The cryptographic usage mask must be specified as an attribute."
|
"The cryptographic usage mask must be specified as an attribute."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create,
|
e._process_create,
|
||||||
|
@ -2735,7 +2762,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic algorithm must be specified as an attribute "
|
"The cryptographic algorithm must be specified as an attribute "
|
||||||
"for the public key."
|
"for the public key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -2801,7 +2829,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic algorithm must be specified as an attribute "
|
"The cryptographic algorithm must be specified as an attribute "
|
||||||
"for the private key."
|
"for the private key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -2867,7 +2896,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic length must be specified as an attribute for "
|
"The cryptographic length must be specified as an attribute for "
|
||||||
"the public key."
|
"the public key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -2933,7 +2963,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic length must be specified as an attribute for "
|
"The cryptographic length must be specified as an attribute for "
|
||||||
"the private key."
|
"the private key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -2997,7 +3028,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic usage mask must be specified as an attribute "
|
"The cryptographic usage mask must be specified as an attribute "
|
||||||
"for the public key."
|
"for the public key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -3061,7 +3093,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
"The cryptographic usage mask must be specified as an attribute "
|
"The cryptographic usage mask must be specified as an attribute "
|
||||||
"for the private key."
|
"for the private key."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -3143,7 +3176,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = (
|
regex = (
|
||||||
"The public and private key algorithms must be the same."
|
"The public and private key algorithms must be the same."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -3212,7 +3246,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
regex = (
|
regex = (
|
||||||
"The public and private key lengths must be the same."
|
"The public and private key lengths must be the same."
|
||||||
)
|
)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_create_key_pair,
|
e._process_create_key_pair,
|
||||||
|
@ -3349,7 +3384,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "The SplitKey object type is not supported."
|
regex = "The SplitKey object type is not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_register,
|
e._process_register,
|
||||||
|
@ -3372,7 +3408,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Cannot register a secret in absentia."
|
regex = "Cannot register a secret in absentia."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.InvalidField,
|
exceptions.InvalidField,
|
||||||
regex,
|
regex,
|
||||||
e._process_register,
|
e._process_register,
|
||||||
|
@ -3479,7 +3516,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Key compression is not supported."
|
regex = "Key compression is not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.KeyCompressionTypeNotSupported,
|
exceptions.KeyCompressionTypeNotSupported,
|
||||||
regex,
|
regex,
|
||||||
e._process_get,
|
e._process_get,
|
||||||
|
@ -3499,7 +3537,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Key wrapping is not supported."
|
regex = "Key wrapping is not supported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.PermissionDenied,
|
exceptions.PermissionDenied,
|
||||||
regex,
|
regex,
|
||||||
e._process_get,
|
e._process_get,
|
||||||
|
@ -3578,7 +3617,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Key format conversion from RAW to OPAQUE is unsupported."
|
regex = "Key format conversion from RAW to OPAQUE is unsupported."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.KeyFormatTypeNotSupported,
|
exceptions.KeyFormatTypeNotSupported,
|
||||||
regex,
|
regex,
|
||||||
e._process_get,
|
e._process_get,
|
||||||
|
@ -3610,7 +3650,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Key format is not applicable to the specified object."
|
regex = "Key format is not applicable to the specified object."
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.KeyFormatTypeNotSupported,
|
exceptions.KeyFormatTypeNotSupported,
|
||||||
regex,
|
regex,
|
||||||
e._process_get,
|
e._process_get,
|
||||||
|
@ -3645,7 +3686,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
# Test by specifying the ID of the object to get.
|
# Test by specifying the ID of the object to get.
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_get,
|
e._process_get,
|
||||||
|
@ -4039,7 +4081,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(id_a)
|
regex = "Could not locate object: {0}".format(id_a)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4065,7 +4108,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(id_b)
|
regex = "Could not locate object: {0}".format(id_b)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4099,7 +4143,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
# Test by specifying the ID of the object to destroy.
|
# Test by specifying the ID of the object to destroy.
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4374,7 +4419,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(uid)
|
regex = "Could not locate object: {0}".format(uid)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4558,7 +4604,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(public_id)
|
regex = "Could not locate object: {0}".format(public_id)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4592,7 +4639,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(private_id)
|
regex = "Could not locate object: {0}".format(private_id)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
@ -4733,7 +4781,8 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = (payload, )
|
args = (payload, )
|
||||||
regex = "Could not locate object: {0}".format(uid)
|
regex = "Could not locate object: {0}".format(uid)
|
||||||
self.assertRaisesRegexp(
|
six.assertRaisesRegex(
|
||||||
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.ItemNotFound,
|
||||||
regex,
|
regex,
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
|
|
Loading…
Reference in New Issue