summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-11 15:33:39 +0100
committerJohn Villalovos <john@sodarock.com>2021-12-11 10:25:08 -0800
commite3035a799a484f8d6c460f57e57d4b59217cd6de (patch)
treec6c37fb24df6da686f070bc55ddcafaab76250ff
parent49af15b3febda5af877da06c3d8c989fbeede00a (diff)
downloadgitlab-e3035a799a484f8d6c460f57e57d4b59217cd6de.tar.gz
chore(api): temporarily remove topic delete endpoint
It is not yet available upstream.
-rw-r--r--docs/gl_objects/topics.rst7
-rw-r--r--gitlab/v4/objects/topics.py6
-rw-r--r--tests/functional/api/test_topics.py3
-rw-r--r--tests/functional/conftest.py2
-rw-r--r--tests/unit/objects/test_topics.py18
5 files changed, 3 insertions, 33 deletions
diff --git a/docs/gl_objects/topics.rst b/docs/gl_objects/topics.rst
index 0ca46d7..5765d63 100644
--- a/docs/gl_objects/topics.rst
+++ b/docs/gl_objects/topics.rst
@@ -39,10 +39,3 @@ Update a topic::
# or
gl.topics.update(topic_id, {"description": "My new topic"})
-
-Delete a topic::
-
- topic.delete()
-
- # or
- gl.topics.delete(topic_id)
diff --git a/gitlab/v4/objects/topics.py b/gitlab/v4/objects/topics.py
index 76208ed..71f6607 100644
--- a/gitlab/v4/objects/topics.py
+++ b/gitlab/v4/objects/topics.py
@@ -2,7 +2,7 @@ from typing import Any, cast, Union
from gitlab import types
from gitlab.base import RequiredOptional, RESTManager, RESTObject
-from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
+from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
__all__ = [
"Topic",
@@ -10,11 +10,11 @@ __all__ = [
]
-class Topic(SaveMixin, ObjectDeleteMixin, RESTObject):
+class Topic(SaveMixin, RESTObject):
pass
-class TopicManager(CRUDMixin, RESTManager):
+class TopicManager(CreateMixin, RetrieveMixin, UpdateMixin, RESTManager):
_path = "/topics"
_obj_cls = Topic
_create_attrs = RequiredOptional(
diff --git a/tests/functional/api/test_topics.py b/tests/functional/api/test_topics.py
index 7ad71a5..dea457c 100644
--- a/tests/functional/api/test_topics.py
+++ b/tests/functional/api/test_topics.py
@@ -16,6 +16,3 @@ def test_topics(gl):
updated_topic = gl.topics.get(topic.id)
assert updated_topic.description == topic.description
-
- topic.delete()
- assert not gl.topics.list()
diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py
index 109ee24..625cff9 100644
--- a/tests/functional/conftest.py
+++ b/tests/functional/conftest.py
@@ -24,8 +24,6 @@ def reset_gitlab(gl):
for deploy_token in group.deploytokens.list():
deploy_token.delete()
group.delete()
- for topic in gl.topics.list():
- topic.delete()
for variable in gl.variables.list():
variable.delete()
for user in gl.users.list():
diff --git a/tests/unit/objects/test_topics.py b/tests/unit/objects/test_topics.py
index 14b2cfd..c0654ac 100644
--- a/tests/unit/objects/test_topics.py
+++ b/tests/unit/objects/test_topics.py
@@ -75,19 +75,6 @@ def resp_update_topic():
yield rsps
-@pytest.fixture
-def resp_delete_topic(no_content):
- with responses.RequestsMock() as rsps:
- rsps.add(
- method=responses.DELETE,
- url=topic_url,
- json=no_content,
- content_type="application/json",
- status=204,
- )
- yield rsps
-
-
def test_list_topics(gl, resp_list_topics):
topics = gl.topics.list()
assert isinstance(topics, list)
@@ -112,8 +99,3 @@ def test_update_topic(gl, resp_update_topic):
topic.name = new_name
topic.save()
assert topic.name == new_name
-
-
-def test_delete_topic(gl, resp_delete_topic):
- topic = gl.topics.get(1, lazy=True)
- topic.delete()