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

chore: deprecate the create_list function #334

Merged
merged 1 commit into from
Jun 14, 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
11 changes: 10 additions & 1 deletion easypost/services/tracker_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
List,
Optional,
)
from warnings import warn

from easypost.constant import _FILTERS_KEY
from easypost.models import Tracker
Expand Down Expand Up @@ -61,7 +62,15 @@ def get_next_page(
return self.all(**params)

def create_list(self, trackers: List[Dict[str, Any]]) -> None:
"""Create a list of Trackers."""
"""Create a list of Trackers.

NOTE: This function is deprecated, use the create function instead.
"""
warn(
"This function is deprecated, use the create function instead.",
DeprecationWarning,
stacklevel=2,
)
url = f"{self._class_url(self._model_class)}/create_list"
wrapped_params = {"trackers": trackers}

Expand Down
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 467 files
718 changes: 456 additions & 262 deletions tests/cassettes/test_order_buy.yaml

Large diffs are not rendered by default.

354 changes: 220 additions & 134 deletions tests/cassettes/test_order_create.yaml

Large diffs are not rendered by default.

649 changes: 409 additions & 240 deletions tests/cassettes/test_order_get_rates.yaml

Large diffs are not rendered by default.

352 changes: 219 additions & 133 deletions tests/cassettes/test_order_lowest_rate.yaml

Large diffs are not rendered by default.

649 changes: 408 additions & 241 deletions tests/cassettes/test_order_retrieve.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/test_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def test_order_lowest_rate(basic_order, test_client):

# Test lowest rate with no filters
lowest_rate = order.lowest_rate()
assert lowest_rate.service == "First"
assert lowest_rate.rate == "6.07"
assert lowest_rate.service == "GroundAdvantage"
assert lowest_rate.rate == "11.33"
assert lowest_rate.carrier == "USPS"

# Test lowest rate with service filter (this rate is higher than the lowest but should filter)
lowest_rate_service = order.lowest_rate(services=["Priority"])
assert lowest_rate_service.service == "Priority"
assert lowest_rate_service.rate == "7.15"
assert lowest_rate_service.rate == "13.79"
assert lowest_rate_service.carrier == "USPS"

# Test lowest rate with carrier filter (should error due to bad carrier)
Expand Down
Loading