Skip to content

Commit

Permalink
fix: spanish email typo (#844)
Browse files Browse the repository at this point in the history
* fix: spanish email typo

* Fix tests

* Linting

* formatting

---------

Co-authored-by: Chris <[email protected]>
  • Loading branch information
elblogbruno and firstof9 authored Sep 18, 2023
1 parent 8651177 commit 1c0a552
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion custom_components/mail_and_packages/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"Dostarczono:",
"Geliefert:",
"Livré",
"Entregado:",
]
AMAZON_SHIPMENT_TRACKING = [
"shipment-tracking",
Expand Down Expand Up @@ -132,7 +133,7 @@
"Per tracciare il tuo pacco",
"View or manage order",
"Acompanhar",
"Sguimiento",
"Seguimiento",
"Verfolge deine(n) Artikel",
"Lieferung verfolgen",
"Ihr Paket verfolgen",
Expand Down
6 changes: 4 additions & 2 deletions custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,12 @@ def resize_images(images: list, width: int, height: int) -> list:
with open(image, "rb") as fd_img:
try:
img = Image.open(fd_img)
img.thumbnail((width, height), resample=Image.LANCZOS)
img.thumbnail((width, height), resample=Image.Resampling.LANCZOS)

# Add padding as needed
img = ImageOps.pad(img, (width, height), method=Image.LANCZOS)
img = ImageOps.pad(
img, (width, height), method=Image.Resampling.LANCZOS
)
# Crop to size
img = img.crop((0, 0, width, height))

Expand Down
6 changes: 3 additions & 3 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ async def test_amazon_search_results(hass, mock_imap_amazon_shipped):
result = amazon_search(
mock_imap_amazon_shipped, "test/path", hass, "testfilename.jpg"
)
assert result == 65
assert result == 78


@pytest.mark.asyncio
Expand All @@ -879,7 +879,7 @@ async def test_amazon_search_delivered(
result = amazon_search(
mock_imap_amazon_delivered, "test/path", hass, "testfilename.jpg"
)
assert result == 65
assert result == 78
assert mock_download_img.called


Expand All @@ -890,7 +890,7 @@ async def test_amazon_search_delivered_it(
result = amazon_search(
mock_imap_amazon_delivered_it, "test/path", hass, "testfilename.jpg"
)
assert result == 65
assert result == 78


@pytest.mark.asyncio
Expand Down

0 comments on commit 1c0a552

Please sign in to comment.