Merge "base.Resource not define __ne__() built-in function"

This commit is contained in:
Jenkins 2016-07-09 12:17:59 +00:00 committed by Gerrit Code Review
commit fbd6708d77
2 changed files with 4 additions and 1 deletions

View File

@ -209,6 +209,9 @@ class Resource(RequestIdMixin):
return self.id == other.id
return self._info == other._info
def __ne__(self, other):
return not self.__eq__(other)
def is_loaded(self):
return self._loaded

View File

@ -63,7 +63,7 @@ class BaseTest(utils.TestCase):
r2 = base.Resource(None, {'id': 1, 'name': 'hello'})
self.assertEqual(r1, r2)
# Two resoruces of different types: never equal
# Two resources of different types: never equal
r1 = base.Resource(None, {'id': 1})
r2 = flavors.Flavor(None, {'id': 1})
self.assertNotEqual(r1, r2)