Skip to content

Commit

Permalink
oop, make mypi and flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Nov 22, 2023
1 parent c90182f commit b1a694e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dandi/support/digests.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ def check_digests(
break
if digest_type is None:
raise RuntimeError(
f"No digest found matching those in priority list. Got {digests.keys()} digests with priority list {priority}"
f"No digest found matching those in priority list. "
f"Got {digests.keys()} digests with priority list {priority}"
)

# return simple comparison
return get_digest(filepath, digest_type) == digest
return bool(get_digest(filepath, digest_type) == digest)
4 changes: 2 additions & 2 deletions dandi/support/tests/test_digests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pytest_mock import MockerFixture

from .. import digests
from ..digests import Digester, get_zarr_checksum, check_digests
from ..digests import Digester, check_digests, get_zarr_checksum


def test_digester(tmp_path):
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_digester(tmp_path):
}


def test_check_digests(tmp_path: Path):
def test_check_digests(tmp_path: Path) -> None:
# we should return True if the highest matching priority digest matches
# the file digest, and false otherwise.
f = tmp_path / "long.txt"
Expand Down
4 changes: 3 additions & 1 deletion dandi/tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def test_download_000027_resume(
@pytest.mark.parametrize(
"dlmode", (DownloadExisting.OVERWRITE_DIFFERENT, DownloadExisting.REFRESH)
)
def test_download_000027_digest(tmp_path: Path, dlmode, caplog):
def test_download_000027_digest(
tmp_path: Path, dlmode: DownloadExisting, caplog: pytest.LogCaptureFixture
) -> None:
from ..support.digests import Digester

# capture logs to test whether downloads happen
Expand Down

0 comments on commit b1a694e

Please sign in to comment.