From 431cb1ed0a90aeb2d83800c405f865a1ce4cfe0e Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:58:03 -0600 Subject: [PATCH] chore: remove create_list tracker function --- CHANGELOG.md | 4 ++ easypost/services/tracker_service.py | 21 ------ tests/cassettes/test_tracker_create_list.yaml | 68 ------------------- tests/test_tracker.py | 15 ---- 4 files changed, 4 insertions(+), 104 deletions(-) delete mode 100644 tests/cassettes/test_tracker_create_list.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index b3c80df..00361ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/easypost/services/tracker_service.py b/easypost/services/tracker_service.py index af81862..2074415 100644 --- a/easypost/services/tracker_service.py +++ b/easypost/services/tracker_service.py @@ -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 @@ -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) diff --git a/tests/cassettes/test_tracker_create_list.yaml b/tests/cassettes/test_tracker_create_list.yaml deleted file mode 100644 index 9229f55..0000000 --- a/tests/cassettes/test_tracker_create_list.yaml +++ /dev/null @@ -1,68 +0,0 @@ -interactions: -- request: - body: '{"trackers": {"0": {"tracking_code": "EZ1000000001"}, "1": {"tracking_code": - "EZ1000000002"}, "2": {"tracking_code": "EZ1000000003"}}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - authorization: - - - user-agent: - - - method: POST - uri: https://api.easypost.com/v2/trackers/create_list - response: - body: - string: '{}' - headers: - cache-control: - - private, no-cache, no-store - content-length: - - '2' - content-type: - - application/json; charset=utf-8 - expires: - - '0' - pragma: - - no-cache - referrer-policy: - - strict-origin-when-cross-origin - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-backend: - - easypost - x-content-type-options: - - nosniff - x-download-options: - - noopen - x-ep-request-uuid: - - 62c1f5dd66be5cede788657e0017738f - x-frame-options: - - SAMEORIGIN - x-node: - - bigweb41nuq - x-permitted-cross-domain-policies: - - none - x-proxied: - - intlb4nuq c0f5e722d1 - - extlb2nuq b6e1b5034c - x-runtime: - - '0.049818' - x-version-label: - - easypost-202408151917-1527448f18-master - x-xss-protection: - - 1; mode=block - status: - code: 200 - message: OK -version: 1 diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 4fb11b0..557d5c0 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -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