Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix get_next_page_of_children function for User service #346

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)