summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_gitlab.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-11-01 17:07:30 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-11-01 17:07:30 +0100
commit38d446737f45ea54136d1f03f75fbddf46c45e00 (patch)
treec4ccbe765f075313d1f7dc1ef476f4f09f172ab1 /gitlab/tests/test_gitlab.py
parentfba7730161c15be222a22b4618d79bb92a87ef1f (diff)
downloadgitlab-38d446737f45ea54136d1f03f75fbddf46c45e00.tar.gz
Pagination generators: expose more information
Expose the X-* pagination attributes returned by the Gitlab server when requesting lists. Closes #304
Diffstat (limited to 'gitlab/tests/test_gitlab.py')
-rw-r--r--gitlab/tests/test_gitlab.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py
index 6bc427d..0f39624 100644
--- a/gitlab/tests/test_gitlab.py
+++ b/gitlab/tests/test_gitlab.py
@@ -209,6 +209,12 @@ class TestGitlabList(unittest.TestCase):
self.assertEqual(len(obj), 2)
self.assertEqual(obj._next_url,
'http://localhost/api/v4/tests?per_page=1&page=2')
+ self.assertEqual(obj.current_page, 1)
+ self.assertEqual(obj.prev_page, None)
+ self.assertEqual(obj.next_page, 2)
+ self.assertEqual(obj.per_page, 1)
+ self.assertEqual(obj.total_pages, 2)
+ self.assertEqual(obj.total, 2)
with HTTMock(resp_2):
l = list(obj)