Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Jun 23, 2024
1 parent eef69ef commit 3848a7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,9 @@ def get_amazon_image(
hass.add_job(download_img(hass, img_url, image_path, image_name))


async def download_img(hass: HomeAssistant, img_url: str, img_path: str, img_name: str) -> None:
async def download_img(
hass: HomeAssistant, img_url: str, img_path: str, img_name: str
) -> None:
"""Download image from url."""
img_path = f"{img_path}amazon/"
filepath = f"{img_path}{img_name}"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ async def test_usps_exception(hass, mock_imap_usps_exception):

@pytest.mark.asyncio
async def test_download_img(
hass,
aioclient_mock,
mock_osremove,
mock_osmakedir,
Expand All @@ -960,6 +961,7 @@ async def test_download_img(
m_open = mock_open()
with patch("builtins.open", m_open, create=True):
await download_img(
hass,
"http://fake.website.com/not/a/real/website/image.jpg",
"/fake/directory/",
"testfilename.jpg",
Expand Down

0 comments on commit 3848a7d

Please sign in to comment.