Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #120 from mozilla-services/25-pagination-load-test
Browse files Browse the repository at this point in the history
Perform continuated pagination in loads tests (ref #25)
  • Loading branch information
Natim committed Mar 3, 2015
2 parents 1025584 + aa3f5ac commit fd87c21
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions loadtests/loadtest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
('poll_changes', 90),
('list_archived', 20),
('list_deleted', 40),
('list_continuated_pagination', 80),
]


Expand Down Expand Up @@ -183,3 +184,13 @@ def list_deleted(self):
deleted_url = self.api_url('articles?_since=%s&deleted=true' % modif)
resp = self.session.get(deleted_url, auth=self.basic_auth)
self.assertEqual(resp.status_code, 200)

def list_continuated_pagination(self):
paginated_url = self.api_url('articles?_limit=20')

while paginated_url:
resp = self.session.get(paginated_url, auth=self.basic_auth)
self.assertEqual(resp.status_code, 200)
next_page = resp.headers.get("Next-Page")
self.assertNotEqual(paginated_url, next_page)
paginated_url = next_page

0 comments on commit fd87c21

Please sign in to comment.