aboutsummaryrefslogtreecommitdiff
path: root/tests/uploader/test_files.py
blob: cb22fff5784c8a15d8572718a2b008a4b6ddca6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Tests functions in the `uploader.files` module."""
from pathlib import Path

import pytest

from uploader.files import sha256_digest_over_file

@pytest.mark.unit_test
@pytest.mark.parametrize(
    "filepath,expectedhash",
    ((Path("tests/test_data/average.tsv.zip"),
      "a371c654c095c030edad468e1c3d6b176ea8adfbcd91a322afd37779044478d9"),
     (Path("tests/test_data/standarderror.tsv"),
      "a08332e0b06391d50eecb722f69d85fbdf374a2d77713ee879d3fd6c60419d55")))
def test_sha256_digest_over_file(filepath: Path, expectedhash: str):
    """Test the `sha256_digest_over_file` function."""
    assert sha256_digest_over_file(filepath) == expectedhash