Skip to content

Commit b5e88f3

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

gitlab/tests/test_gitlab.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ 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(scheme="http", netloc="localhost", path="/api/v4/tests", method="get")
124+
def resp(url, request):
125+
headers = {
126+
"content-type": "application/json",
127+
"X-Page": 2,
128+
"X-Next-Page": 2,
129+
"X-Per-Page": 1,
130+
"X-Total-Pages": 2,
131+
"X-Total": 2,
132+
}
133+
content = '[{"c": "d"}]'
134+
return response(200, content, headers, None, 5, request)
135+
136+
with HTTMock(resp):
137+
result = self.gl.http_list("/tests", as_list=False, all=True)
138+
self.assertIsInstance(result, GitlabList)
139+
122140

123141
class TestGitlabHttpMethods(unittest.TestCase):
124142
def setUp(self):

0 commit comments

Comments
 (0)