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.

Change-Id: I819cb27664661e0b67d1e886c28432a2d1134cb0
Closes-Bug: #1586268
This commit is contained in:
Ji-Wei 2016-07-14 17:33:11 +08:00
parent db90b6f6df
commit 5cebb31c09
1 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,9 @@ class Model(object):
def __eq__(self, other):
return self.as_dict() == other.as_dict()
def __ne__(self, other):
return not self.__eq__(other)
@classmethod
def get_field_names(cls):
fields = inspect.getargspec(cls.__init__)[0]