Skip to content

Commit

Permalink
test: test that all is ignored, when as_list=False
Browse files Browse the repository at this point in the history
  • Loading branch information
max-wittig committed Dec 8, 2019
1 parent 06a8050 commit b5e88f3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gitlab/tests/test_gitlab.py
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

0 comments on commit b5e88f3

Please sign in to comment.