summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryuyafei <yu.yafei@zte.com.cn>2016-07-04 16:17:51 +0800
committeryuyafei <yu.yafei@zte.com.cn>2016-07-04 07:11:33 +0000
commit4c2a88b95905ab724a5fff5b19ff10c1ca43f4a3 (patch)
tree32956e7fbb2d742a1ea238bdc47f290cfbe00aeb
parente84621ecc0e3c774a031ea6d29875a9313008bd0 (diff)
downloadpython-heatclient-4c2a88b95905ab724a5fff5b19ff10c1ca43f4a3.tar.gz
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
-rw-r--r--heatclient/openstack/common/apiclient/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/heatclient/openstack/common/apiclient/base.py b/heatclient/openstack/common/apiclient/base.py
index 8251e4f..0a99ab2 100644
--- a/heatclient/openstack/common/apiclient/base.py
+++ b/heatclient/openstack/common/apiclient/base.py
@@ -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__):