Merge "Add __ne__ built-in function for astara"

This commit is contained in:
Jenkins 2016-10-05 14:12:39 +00:00 committed by Gerrit Code Review
commit 7b7dfc202d
3 changed files with 12 additions and 0 deletions

View File

@ -362,6 +362,9 @@ class Port(DictModelBase):
def __eq__(self, other):
return type(self) == type(other) and vars(self) == vars(other)
def __ne__(self, other):
return not self.__eq__(other)
@property
def first_v4(self):
for fixed_ip in self.fixed_ips:
@ -396,6 +399,9 @@ class FixedIp(DictModelBase):
def __eq__(self, other):
return type(self) == type(other) and vars(self) == vars(other)
def __ne__(self, other):
return not self.__eq__(other)
@classmethod
def from_dict(cls, d):
return cls(d['subnet_id'], d['ip_address'])

View File

@ -160,6 +160,9 @@ class IPDevice(SubProcessBase):
return (other is not None and self.name == other.name and
self.namespace == other.namespace)
def __ne__(self, other):
return not self.__eq__(other)
def __str__(self):
return self.name

View File

@ -62,6 +62,9 @@ class TestDebug(base.RugTestBase):
def __eq__(self, other):
return self.crud == other.crud
def __ne__(self, other):
return not self.__eq__(other)
automaton.return_value.send_message.assert_called_once_with(
CrudMatch('update')
)