Skip to content

Commit

Permalink
Fixed an issue with the pagination simulator for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeman committed Oct 16, 2016
1 parent b74a4b0 commit fc3e27c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/core/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json

from six.moves.urllib_parse import urlparse, parse_qsl
import json
import math
import os
import pytest
import six
Expand Down Expand Up @@ -74,12 +74,16 @@ def callback(request):
return 404, {}, ''

# Return page response
page_count = int(math.ceil(
float(len(collection)) / limit
))

return (
200, {
'Content-Type': 'application/json',
'X-Pagination-Page': str(page),
'X-Pagination-Limit': str(limit),
'X-Pagination-Page-Count': str(int(len(collection) / limit)),
'X-Pagination-Page-Count': str(page_count),
'X-Pagination-Item-Count': str(len(collection))
},
json.dumps(items)
Expand Down

0 comments on commit fc3e27c

Please sign in to comment.