Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffdef9b

Browse files
chore(topics): 'title' is required when creating a topic
1 parent69014e9 commitffdef9b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

‎gitlab/v4/objects/topics.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TopicManager(CRUDMixin, RESTManager):
1919
_path="/topics"
2020
_obj_cls=Topic
2121
_create_attrs=RequiredOptional(
22-
required=("name",),optional=("avatar","description")
22+
required=("name","title"),optional=("avatar","description")
2323
)
2424
_update_attrs=RequiredOptional(optional=("avatar","description","name"))
2525
_types= {"avatar":types.ImageAttribute}

‎tests/functional/api/test_topics.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
deftest_topics(gl):
88
assertnotgl.topics.list()
99

10-
topic=gl.topics.create({"name":"my-topic","description":"My Topic"})
10+
topic=gl.topics.create(
11+
{"name":"my-topic","title":"my topic title","description":"My Topic"}
12+
)
1113
asserttopic.name=="my-topic"
14+
asserttopic.title=="my topic title"
1215
assertgl.topics.list()
1316

1417
topic.description="My Updated Topic"

‎tests/unit/objects/test_topics.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
fromgitlab.v4.objectsimportTopic
99

1010
name="GitLab"
11+
topic_title="topic title"
1112
new_name="gitlab-test"
1213
topic_content= {
1314
"id":1,
1415
"name":name,
16+
"title":topic_title,
1517
"description":"GitLab is an open source end-to-end software development platform.",
1618
"total_projects_count":1000,
1719
"avatar_url":"http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
@@ -102,9 +104,10 @@ def test_get_topic(gl, resp_get_topic):
102104

103105

104106
deftest_create_topic(gl,resp_create_topic):
105-
topic=gl.topics.create({"name":name})
107+
topic=gl.topics.create({"name":name,"title":topic_title})
106108
assertisinstance(topic,Topic)
107109
asserttopic.name==name
110+
asserttopic.title==topic_title
108111

109112

110113
deftest_update_topic(gl,resp_update_topic):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp