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

Fix/as list#963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bufferoverflow merged 3 commits intomasterfromfix/as_list
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ jobs:
dist: bionic
python: 3.7
script:
- pip3 install black
- pip3 install-U --preblack
- black --check .
- stage: test
name: cli_func_v4
Expand Down
2 changes: 1 addition & 1 deletiongitlab/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -630,7 +630,7 @@ def http_list(self, path, query_data=None, as_list=None, **kwargs):
get_all = kwargs.pop("all", False)
url = self._build_url(path)

if get_all is True:
if get_all is True and as_list is True:
return list(GitlabList(self, url, query_data, **kwargs))

if "page" in kwargs or as_list is True:
Expand Down
18 changes: 18 additions & 0 deletionsgitlab/tests/test_gitlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -119,6 +119,24 @@ def resp_2(url, request):
self.assertEqual(l[0]["a"], "b")
self.assertEqual(l[1]["c"], "d")

def test_all_omitted_when_as_list(self):
@urlmatch(scheme="http", netloc="localhost", path="/api/v4/tests", method="get")
def resp(url, request):
headers = {
"content-type": "application/json",
"X-Page": 2,
"X-Next-Page": 2,
"X-Per-Page": 1,
"X-Total-Pages": 2,
"X-Total": 2,
}
content = '[{"c": "d"}]'
return response(200, content, headers, None, 5, request)

with HTTMock(resp):
result = self.gl.http_list("/tests", as_list=False, all=True)
self.assertIsInstance(result, GitlabList)


class TestGitlabHttpMethods(unittest.TestCase):
def setUp(self):
Expand Down
8 changes: 4 additions & 4 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -762,8 +762,8 @@ class GroupClusterManager(CRUDMixin, RESTManager):
_obj_cls = GroupCluster
_from_parent_attrs = {"group_id": "id"}
_create_attrs = (
("name", "platform_kubernetes_attributes",),
("domain", "enabled", "managed", "environment_scope",),
("name", "platform_kubernetes_attributes"),
("domain", "enabled", "managed", "environment_scope"),
)
_update_attrs = (
tuple(),
Expand DownExpand Up@@ -1664,8 +1664,8 @@ class ProjectClusterManager(CRUDMixin, RESTManager):
_obj_cls = ProjectCluster
_from_parent_attrs = {"project_id": "id"}
_create_attrs = (
("name", "platform_kubernetes_attributes",),
("domain", "enabled", "managed", "environment_scope",),
("name", "platform_kubernetes_attributes"),
("domain", "enabled", "managed", "environment_scope"),
)
_update_attrs = (
tuple(),
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp