forked from loafle/openapi-generator-original
add eq for python, update test case
This commit is contained in:
@@ -113,5 +113,18 @@ class {{classname}}(object):
|
||||
For `print` and `pprint`
|
||||
"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Returns true if both objects are equal
|
||||
"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Returns true if both objects are not equal
|
||||
"""
|
||||
return not self == other
|
||||
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
||||
Reference in New Issue
Block a user