Skip to content

Commit 7cf4936

Browse files
committed
Update pag list test with no header no next meta to run properly. Update changelog.
1 parent 94e34d2 commit 7cf4936

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### General
6+
7+
- Added support for pagination with metadata when headers are missing (Thanks, [@bennettscience](https://github.com/bennettscience))
8+
59
## [3.1.0] - 2023-04-21
610

711
### New Endpoint Coverage

tests/fixtures/paginated_list.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,16 @@
158158
"method": "ANY",
159159
"endpoint": "no_header_no_next_key",
160160
"data": {
161-
"assessments": [],
161+
"assessments": [
162+
{
163+
"id": "1",
164+
"name": "object 1"
165+
},
166+
{
167+
"id": "2",
168+
"name": "object 2"
169+
}
170+
],
162171
"meta": {
163172
"pagination": {
164173
"prev": "https://example.com/api/v1/previous"
@@ -167,4 +176,4 @@
167176
}
168177
},
169178
"status_code": 200
170-
}
179+
}

tests/test_paginated_list.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,5 @@ def test_paginated_list_no_header_no_next(self, m):
231231
)
232232

233233
self.assertIsInstance(pag_list, PaginatedList)
234+
self.assertEqual(len(list(pag_list)), 2)
235+
self.assertIsInstance(pag_list[0], User)

0 commit comments

Comments
 (0)