Class Credentials not define __ne__() built-in function
Class Credentials 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: I2c0d9d6202d64de57700ceb7c15db8ed3ad7e8ff Closes-Bug: #1586268
This commit is contained in:
parent
22afc4b8ec
commit
79f5efd468
|
@ -689,6 +689,10 @@ class Credentials(object):
|
||||||
"""Credentials are equal if attributes in self.ATTRIBUTES are equal"""
|
"""Credentials are equal if attributes in self.ATTRIBUTES are equal"""
|
||||||
return str(self) == str(other)
|
return str(self) == str(other)
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Contrary to the __eq__"""
|
||||||
|
return not self.__eq__(other)
|
||||||
|
|
||||||
def __getattr__(self, key):
|
def __getattr__(self, key):
|
||||||
# If an attribute is set, __getattr__ is not invoked
|
# If an attribute is set, __getattr__ is not invoked
|
||||||
# If an attribute is not set, and it is a known one, return None
|
# If an attribute is not set, and it is a known one, return None
|
||||||
|
|
Loading…
Reference in New Issue