Skip to content

Commit 151f7d3

Browse files
committed
feat: adds verify_carrier address param
1 parent 0e6782f commit 151f7d3

File tree

6 files changed

+103
-3
lines changed

6 files changed

+103
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# CHANGELOG
22

3-
## Next Release
3+
## v10.2.0 (2025-11-10)
44

55
- Adds `UspsShipAccount` support to the create carrier method
66
- Adds `tracker.retrieve_batch` function
7+
- Adds `verify_carrier` address param
78

89
## v10.1.0 (2025-06-18)
910

easypost/constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flake8: noqa
22
# Library version
3-
VERSION = "10.1.0"
3+
VERSION = "10.2.0"
44
VERSION_INFO = [str(number) for number in VERSION.split(".")]
55

66
# Client defaults

easypost/services/address_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def create(
2121
self,
2222
verify: Optional[bool] = None,
2323
verify_strict: Optional[bool] = None,
24+
verify_carrier: Optional[str] = None,
2425
**params,
2526
) -> Address:
2627
"""Create an Address."""
@@ -31,6 +32,8 @@ def create(
3132
wrapped_params["verify"] = verify
3233
if verify_strict:
3334
wrapped_params["verify_strict"] = verify_strict
35+
if verify_carrier:
36+
wrapped_params["verify_carrier"] = verify_carrier
3437

3538
response = Requestor(self._client).request(method=RequestMethod.POST, url=url, params=wrapped_params)
3639

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
setup(
2929
name="easypost",
30-
version="10.1.0",
30+
version="10.2.0",
3131
description="EasyPost Shipping API Client Library for Python",
3232
author="EasyPost",
3333
author_email="[email protected]",

tests/cassettes/test_address_create_verify_carrier.yaml

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_address.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from easypost.constant import (
34
_FILTERS_KEY,
45
_TEST_FAILED_INTENTIONALLY_ERROR,
@@ -155,3 +156,16 @@ def test_address_verify_invalid_address(test_client):
155156
test_client.address.verify(address.id)
156157

157158
assert str(error.value) == "Unable to verify address."
159+
160+
161+
@pytest.mark.vcr()
162+
def test_address_create_verify_carrier(incorrect_address, test_client):
163+
"""Test creating an address with the `verify_carrier` param."""
164+
incorrect_address["verify"] = True
165+
incorrect_address["verify_carrier"] = "UPS"
166+
address = test_client.address.create(**incorrect_address)
167+
168+
assert isinstance(address, Address)
169+
170+
assert address.verifications.delivery.errors[0].message == "Address not found"
171+
assert address.verifications.zip4.errors[0].message == "Address not found"

0 commit comments

Comments
 (0)