summaryrefslogtreecommitdiff
path: root/gitlab/tests
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-03-07 11:31:23 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-03-10 08:37:07 -0800
commit147f05d43d302d9a04bc87d957c79ce9e54cdaed (patch)
treebb639917a30dbb3de31bf6e47ea022794626bc1c /gitlab/tests
parent6fde2437e82aeb8af903f81e351790b4695074a1 (diff)
downloadgitlab-147f05d43d302d9a04bc87d957c79ce9e54cdaed.tar.gz
chore: add _create_attrs & _update_attrs to RESTManager
Add the attributes: _create_attrs and _update_attrs to the RESTManager class. This is so that we stop using getattr() if we don't need to. This also helps with type-hints being available for these attributes.
Diffstat (limited to 'gitlab/tests')
-rw-r--r--gitlab/tests/mixins/test_mixin_methods.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/gitlab/tests/mixins/test_mixin_methods.py b/gitlab/tests/mixins/test_mixin_methods.py
index 171e90c..1dafa74 100644
--- a/gitlab/tests/mixins/test_mixin_methods.py
+++ b/gitlab/tests/mixins/test_mixin_methods.py
@@ -129,27 +129,6 @@ def test_list_other_url(gl):
obj_list.next()
-def test_create_mixin_get_attrs(gl):
- class M1(CreateMixin, FakeManager):
- pass
-
- class M2(CreateMixin, FakeManager):
- _create_attrs = (("foo",), ("bar", "baz"))
- _update_attrs = (("foo",), ("bam",))
-
- mgr = M1(gl)
- required, optional = mgr.get_create_attrs()
- assert len(required) == 0
- assert len(optional) == 0
-
- mgr = M2(gl)
- required, optional = mgr.get_create_attrs()
- assert "foo" in required
- assert "bar" in optional
- assert "baz" in optional
- assert "bam" not in optional
-
-
def test_create_mixin_missing_attrs(gl):
class M(CreateMixin, FakeManager):
_create_attrs = (("foo",), ("bar", "baz"))
@@ -202,27 +181,6 @@ def test_create_mixin_custom_path(gl):
assert obj.foo == "bar"
-def test_update_mixin_get_attrs(gl):
- class M1(UpdateMixin, FakeManager):
- pass
-
- class M2(UpdateMixin, FakeManager):
- _create_attrs = (("foo",), ("bar", "baz"))
- _update_attrs = (("foo",), ("bam",))
-
- mgr = M1(gl)
- required, optional = mgr.get_update_attrs()
- assert len(required) == 0
- assert len(optional) == 0
-
- mgr = M2(gl)
- required, optional = mgr.get_update_attrs()
- assert "foo" in required
- assert "bam" in optional
- assert "bar" not in optional
- assert "baz" not in optional
-
-
def test_update_mixin_missing_attrs(gl):
class M(UpdateMixin, FakeManager):
_update_attrs = (("foo",), ("bar", "baz"))