Skip to content

Commit c42aae6

Browse files
authored
Merge pull request #82 from ImageMarkup/lowercase-jpg
Download images to lowercase jpg
2 parents 38a1f37 + 4e5291d commit c42aae6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

isic_cli/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _sentry_setup():
109109
@click.option("-v", "--verbose", is_flag=True, help="Enable verbose mode.")
110110
@click.version_option()
111111
@click.pass_context
112-
def cli(ctx, verbose: bool, guest: bool, sandbox: bool, dev: bool, no_version_check: bool): # noqa: FBT001, C901, PLR0912, PLR0913
112+
def cli(ctx, verbose: bool, guest: bool, sandbox: bool, dev: bool, no_version_check: bool): # noqa: FBT001, C901, PLR0913
113113
logger.addHandler(logging.StreamHandler(sys.stderr))
114114
logger.setLevel(logging.WARNING)
115115

isic_cli/io/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_license(session: IsicCliSession, license_type: str) -> str:
127127
before_sleep=before_sleep_log(logger, logging.DEBUG),
128128
)
129129
def download_image(image: dict, to: Path, progress, task) -> None:
130-
dest_path = to / f'{image["isic_id"]}.JPG'
130+
dest_path = to / f'{image["isic_id"]}.jpg'
131131

132132
# Avoid re downloading the image if one of the same name/size exists. This is a decent
133133
# enough proxy for detecting file differences without going through a hashing mechanism.

tests/test_cli_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def outdir():
1313
@pytest.fixture()
1414
def _mock_images(mocker, _isolated_filesystem, outdir):
1515
def _download_image_side_effect(*args, **kwargs):
16-
with (Path(outdir) / "ISIC_0000000.JPG").open("wb") as f:
16+
with (Path(outdir) / "ISIC_0000000.jpg").open("wb") as f:
1717
f.write(b"12345")
1818

1919
mocker.patch("isic_cli.cli.image.get_num_images", return_value=1)
@@ -41,7 +41,7 @@ def test_image_download(cli_run, outdir):
4141
result = cli_run(["image", "download", outdir])
4242

4343
assert result.exit_code == 0, result.exception
44-
assert Path(f"{outdir}/ISIC_0000000.JPG").exists()
44+
assert Path(f"{outdir}/ISIC_0000000.jpg").exists()
4545
assert Path(f"{outdir}/metadata.csv").exists()
4646
assert Path(f"{outdir}/attribution.txt").exists()
4747
assert Path(f"{outdir}/licenses/CC-0.txt").exists()

0 commit comments

Comments
 (0)