base.Resource not define __ne__() built-in function
Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case in python2. This patch fixes it by defining __eq__() built-in function of class base.Resource. Change-Id: I13ed9ddd6ae6ef074232b33695916bc83930dcf0 Closes-Bug: #1586268
This commit is contained in:
parent
e84621ecc0
commit
4c2a88b959
|
@ -529,6 +529,9 @@ class Resource(object):
|
|||
"function."))
|
||||
return self._info == other._info
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def is_same_obj(self, other):
|
||||
"""Identify the two objects are same one with same id."""
|
||||
if isinstance(other, self.__class__):
|
||||
|
|
Loading…
Reference in New Issue