Merge "Add __ne__ built-in function for astara"
This commit is contained in:
commit
7b7dfc202d
|
@ -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'])
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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')
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue