Skip to content

Commit 40aa055

Browse files
committed
minor
1 parent c7f48b5 commit 40aa055

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

chizhik_api/endpoints/general.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ async def download_image(self,
2828
retry_options = ExponentialRetry(attempts=retry_attempts, start_timeout=3.0, max_timeout=timeout)
2929

3030
async with RetryClient(retry_options=retry_options) as retry_client:
31-
async with retry_client.get(url) as resp:
32-
resp.raise_for_status()
33-
31+
async with retry_client.get(url, raise_for_status=True) as resp:
3432
body = await resp.read()
3533
file = BytesIO(body)
3634
file.name = url.split("/")[-1]

tests/api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def test_product_info(api, product_data, schemashot):
7474

7575

7676
async def test_download_image(api):
77-
url = "https://chizhik.x5static.net/media/chizhik-assets/product_images/3060608.jpg"
77+
url = "https://chizhik.x5static.net/media/chizhik-assets/categories/icon/Type%D0%9C%D0%BE%D0%BB%D0%BE%D1%87%D0%BD%D1%8B%D0%B5_%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D1%8B.png"
7878
resp = await api.General.download_image(url)
7979

8080
with Image.open(resp) as img:

0 commit comments

Comments
 (0)