Skip to content

Commit 8df1e04

Browse files
committed
test: test that all is ignored, when as_list=False
1 parent 06a8050 commit 8df1e04

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

gitlab/tests/test_gitlab.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,28 @@ def resp_2(url, request):
119119
self.assertEqual(l[0]["a"], "b")
120120
self.assertEqual(l[1]["c"], "d")
121121

122+
def test_all_omitted_when_as_list(self):
123+
@urlmatch(
124+
scheme="http",
125+
netloc="localhost",
126+
path="/api/v4/tests",
127+
method="get",
128+
)
129+
def resp(url, request):
130+
headers = {
131+
"content-type": "application/json",
132+
"X-Page": 2,
133+
"X-Next-Page": 2,
134+
"X-Per-Page": 1,
135+
"X-Total-Pages": 2,
136+
"X-Total": 2,
137+
}
138+
content = '[{"c": "d"}]'
139+
return response(200, content, headers, None, 5, request)
140+
141+
with HTTMock(resp):
142+
result = self.gl.http_list("/tests", as_list=False, all=True)
143+
self.assertIsInstance(result, GitlabList)
122144

123145
class TestGitlabHttpMethods(unittest.TestCase):
124146
def setUp(self):

0 commit comments

Comments
 (0)