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

Commitd065275

Browse files
JohnVillalovosnejch
authored andcommitted
fix: Haveparticipants() method usehttp_list()
Previously it was using `http_get()` but the `participants` APIreturns a list of participants. Also by using this then we will warnif only a subset of the participants are returned.Closes:#2913
1 parent51d8f88 commitd065275

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

‎gitlab/mixins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,9 @@ class ParticipantsMixin(_RestObjectBase):
911911

912912
@cli.register_custom_action(cls_names=("ProjectMergeRequest","ProjectIssue"))
913913
@exc.on_http_error(exc.GitlabListError)
914-
defparticipants(self,**kwargs:Any)->Dict[str,Any]:
914+
defparticipants(
915+
self,**kwargs:Any
916+
)->Union[gitlab.client.GitlabList,List[Dict[str,Any]]]:
915917
"""List the participants.
916918
917919
Args:
@@ -929,7 +931,7 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]:
929931
"""
930932

931933
path=f"{self.manager.path}/{self.encoded_id}/participants"
932-
result=self.manager.gitlab.http_get(path,**kwargs)
934+
result=self.manager.gitlab.http_list(path,**kwargs)
933935
ifTYPE_CHECKING:
934936
assertnotisinstance(result,requests.Response)
935937
returnresult

‎tests/functional/api/test_issues.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def test_create_issue(project):
1818
assertissueinproject.issues.list(state="opened")
1919
assertissue2inproject.issues.list(state="closed")
2020

21-
assertissue.participants()
21+
participants=issue.participants()
22+
assertparticipants
23+
assertisinstance(participants,list)
2224
asserttype(issue.closed_by())==list
2325
asserttype(issue.related_merge_requests())==list
2426

‎tests/functional/api/test_merge_requests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def test_merge_request_basic(project):
104104
# basic testing: only make sure that the methods exist
105105
mr.commits()
106106
mr.changes()
107-
assertmr.participants()
107+
participants=mr.participants()
108+
assertparticipants
109+
assertisinstance(participants,list)
108110

109111

110112
deftest_merge_request_rebase(project):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp