summaryrefslogtreecommitdiff
path: root/gitlab/base.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-06-05 08:48:18 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2017-06-05 08:48:18 +0200
commit0d94ee228b6ac1ffef4c4cac68a4e4757a6a824c (patch)
tree052554fc06f39b50916ec2f062c032bb0e655bdb /gitlab/base.py
parenta5b39a526035c1868a39f0533f019e5e24eeb4db (diff)
downloadgitlab-0d94ee228b6ac1ffef4c4cac68a4e4757a6a824c.tar.gz
Unit tests for REST* classes
Diffstat (limited to 'gitlab/base.py')
-rw-r--r--gitlab/base.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/gitlab/base.py b/gitlab/base.py
index 8949554..c318c1d 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -540,8 +540,8 @@ class RESTObject(object):
another. This allows smart updates, if the object allows it.
You can redefine ``_id_attr`` in child classes to specify which attribute
- must be used as uniq ID. None means that the object can be updated without
- ID in the url.
+ must be used as uniq ID. ``None`` means that the object can be updated
+ without ID in the url.
"""
_id_attr = 'id'
@@ -594,8 +594,8 @@ class RESTObject(object):
self.__dict__[attr] = manager
def _update_attrs(self, new_attrs):
- self._updated_attrs = {}
- self._attrs.update(new_attrs)
+ self.__dict__['_updated_attrs'] = {}
+ self.__dict__['_attrs'].update(new_attrs)
def get_id(self):
if self._id_attr is None:
@@ -649,6 +649,13 @@ class RESTManager(object):
_obj_cls = None
def __init__(self, gl, parent=None):
+ """REST manager constructor.
+
+ Args:
+ gl (Gitlab): :class:`~gitlab.Gitlab` connection to use to make
+ requests.
+ parent: REST object to which the manager is attached.
+ """
self.gitlab = gl
self._parent = parent # for nested managers
self._computed_path = self._compute_path()