2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-17 16:53:48 +00:00

Add Attribute class unit tests

This pull request:

- Adds the comparison operators to the following classes:

 -- Attribute.AttributeName class

- Fixes bug in the "_create_cryptographic_parameters" function when "None" type parameters are used

- Adds read, write, and comparator unit tests for the Attribute class in the /kmip/core/objects.py file

Signed-off-by: Hadi Esiely <hadi.esiely-barrera@jhuapl.edu>
This commit is contained in:
Hadi Esiely
2016-03-01 10:53:29 -05:00
parent 79696e3ef5
commit a7c41c758b
5 changed files with 235 additions and 19 deletions

View File

@@ -49,6 +49,21 @@ class Attribute(Struct):
super(Attribute.AttributeName, self).__init__(
value, Tags.ATTRIBUTE_NAME)
def __eq__(self, other):
if isinstance(other, Attribute.AttributeName):
if self.value != other.value:
return False
else:
return True
else:
NotImplemented
def __ne__(self, other):
if isinstance(other, Attribute.AttributeName):
return not (self == other)
else:
return NotImplemented
class AttributeIndex(Integer):
def __init__(self, value=None):