summaryrefslogtreecommitdiff
path: root/tests/unit/objects
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-04-01 11:10:30 +0200
committerJohn Villalovos <john@sodarock.com>2022-04-01 08:22:19 -0700
commitd1d96bda5f1c6991c8ea61dca8f261e5b74b5ab6 (patch)
tree10826fedd12e4dc722c35bda11084fead8c5ceb9 /tests/unit/objects
parent8db68411d6444787ca339cf50dd96b2ab41de60c (diff)
downloadgitlab-d1d96bda5f1c6991c8ea61dca8f261e5b74b5ab6.tar.gz
feat(api): re-add topic delete endpoint
This reverts commit e3035a799a484f8d6c460f57e57d4b59217cd6de.
Diffstat (limited to 'tests/unit/objects')
-rw-r--r--tests/unit/objects/test_topics.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/objects/test_topics.py b/tests/unit/objects/test_topics.py
index c0654ac..14b2cfd 100644
--- a/tests/unit/objects/test_topics.py
+++ b/tests/unit/objects/test_topics.py
@@ -75,6 +75,19 @@ 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)
@@ -99,3 +112,8 @@ 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()