Skip to content

Commit e3035a7

Browse files
nejchJohnVillalovos
authored andcommitted
chore(api): temporarily remove topic delete endpoint
It is not yet available upstream.
1 parent 49af15b commit e3035a7

File tree

5 files changed

+3
-33
lines changed

5 files changed

+3
-33
lines changed

docs/gl_objects/topics.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,3 @@ Update a topic::
3939

4040
# or
4141
gl.topics.update(topic_id, {"description": "My new topic"})
42-
43-
Delete a topic::
44-
45-
topic.delete()
46-
47-
# or
48-
gl.topics.delete(topic_id)

gitlab/v4/objects/topics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
from gitlab import types
44
from gitlab.base import RequiredOptional, RESTManager, RESTObject
5-
from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin
5+
from gitlab.mixins import CreateMixin, RetrieveMixin, SaveMixin, UpdateMixin
66

77
__all__ = [
88
"Topic",
99
"TopicManager",
1010
]
1111

1212

13-
class Topic(SaveMixin, ObjectDeleteMixin, RESTObject):
13+
class Topic(SaveMixin, RESTObject):
1414
pass
1515

1616

17-
class TopicManager(CRUDMixin, RESTManager):
17+
class TopicManager(CreateMixin, RetrieveMixin, UpdateMixin, RESTManager):
1818
_path = "/topics"
1919
_obj_cls = Topic
2020
_create_attrs = RequiredOptional(

tests/functional/api/test_topics.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ def test_topics(gl):
1616

1717
updated_topic = gl.topics.get(topic.id)
1818
assert updated_topic.description == topic.description
19-
20-
topic.delete()
21-
assert not gl.topics.list()

tests/functional/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def reset_gitlab(gl):
2424
for deploy_token in group.deploytokens.list():
2525
deploy_token.delete()
2626
group.delete()
27-
for topic in gl.topics.list():
28-
topic.delete()
2927
for variable in gl.variables.list():
3028
variable.delete()
3129
for user in gl.users.list():

tests/unit/objects/test_topics.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ def resp_update_topic():
7575
yield rsps
7676

7777

78-
@pytest.fixture
79-
def resp_delete_topic(no_content):
80-
with responses.RequestsMock() as rsps:
81-
rsps.add(
82-
method=responses.DELETE,
83-
url=topic_url,
84-
json=no_content,
85-
content_type="application/json",
86-
status=204,
87-
)
88-
yield rsps
89-
90-
9178
def test_list_topics(gl, resp_list_topics):
9279
topics = gl.topics.list()
9380
assert isinstance(topics, list)
@@ -112,8 +99,3 @@ def test_update_topic(gl, resp_update_topic):
11299
topic.name = new_name
113100
topic.save()
114101
assert topic.name == new_name
115-
116-
117-
def test_delete_topic(gl, resp_delete_topic):
118-
topic = gl.topics.get(1, lazy=True)
119-
topic.delete()

0 commit comments

Comments
 (0)