Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 54efc59

Browse files
committed
add __eq__ to AtomxModel
1 parent 476a416 commit 54efc59

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

atomx/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Atomx(object):
3737
:return: :class:`.Atomx` session to interact with the api
3838
"""
3939
def __init__(self, email, password, api_endpoint=API_ENDPOINT):
40+
self.auth_tk = None
4041
self.email = email
4142
self.password = password
4243
self.api_endpoint = api_endpoint.rstrip('/') + '/'

atomx/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def __dir__(self):
7171
def __repr__(self):
7272
return '{}({})'.format(self.__class__.__name__, pprint.pformat(self.json))
7373

74+
def __eq__(self, other):
75+
return self.id == getattr(other, 'id', 'INVALID')
76+
7477
@property
7578
def _resource_name(self):
7679
from atomx.utils import model_name_to_rest

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
keywords='atomx rest api',
4848

4949
setup_requires=['setuptools_git'],
50+
tests_require=['pytest'],
5051
install_requires=requires,
51-
extra_require=extra_require,
52+
extras_require=extra_require,
5253
)

0 commit comments

Comments
 (0)