Skip to content

Commit

Permalink
fix get_next_page_of_children function for User service (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen293 committed Aug 2, 2024
1 parent 387e1a3 commit 0f0309f
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next Release

- Fix `get_next_page_of_children` function for User service with correct filter key

## v9.4.0 (2024-07-24)

- Adds new `Claim` service for filing claims on EasyPost shipments and insurances
Expand Down
2 changes: 1 addition & 1 deletion easypost/services/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_next_page_of_children(
self._check_has_next_page(collection=children)

params = {
"before_id": children["children"][-1].id,
"after_id": children["children"][-1].id,
"page_size": page_size,
}

Expand Down
97 changes: 89 additions & 8 deletions tests/cassettes/test_user_children_get_next_page.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions tests/test_user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
NO_MORE_PAGES_ERROR,
)
Expand Down Expand Up @@ -105,9 +104,6 @@ def test_user_children_get_next_page(prod_client, page_size):
first_id_of_second_page = next_page["children"][0].id

assert first_id_of_first_page != first_id_of_second_page

# Verify that the filters are being passed along for behind-the-scenes reference
assert first_page[_FILTERS_KEY] == next_page[_FILTERS_KEY]
except Exception as e:
if e.message != NO_MORE_PAGES_ERROR:
raise Exception(_TEST_FAILED_INTENTIONALLY_ERROR)

0 comments on commit 0f0309f

Please sign in to comment.