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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user