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: remove create_list tracker function #350

Merged
merged 1 commit into from
Sep 23, 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

- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API

## v9.4.1 (2024-08-09)

- Fix `get_next_page_of_children` function for User service with correct filter key
Expand Down
21 changes: 0 additions & 21 deletions easypost/services/tracker_service.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
from typing import (
Any,
Dict,
List,
Optional,
)
from warnings import warn

from easypost.constant import _FILTERS_KEY
from easypost.models import Tracker
from easypost.requestor import (
RequestMethod,
Requestor,
)
from easypost.services.base_service import BaseService


Expand Down Expand Up @@ -60,18 +54,3 @@ def get_next_page(
params.update(optional_params)

return self.all(**params)

def create_list(self, trackers: List[Dict[str, Any]]) -> None:
"""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}

Requestor(self._client).request(method=RequestMethod.POST, url=url, params=wrapped_params)
68 changes: 0 additions & 68 deletions tests/cassettes/test_tracker_create_list.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions tests/test_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,3 @@ def test_tracker_get_next_page(page_size, test_client):
except Exception as e:
if e.message != NO_MORE_PAGES_ERROR:
raise Exception(_TEST_FAILED_INTENTIONALLY_ERROR)


@pytest.mark.vcr()
def test_tracker_create_list(test_client):
"""Tests that we can create a list of trackers in bulk."""
try:
test_client.tracker.create_list(
{
"0": {"tracking_code": "EZ1000000001"},
"1": {"tracking_code": "EZ1000000002"},
"2": {"tracking_code": "EZ1000000003"},
}
)
except Exception:
assert False