aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py4
-rw-r--r--tests/uploader/__init__.py (renamed from tests/qc_app/__init__.py)0
-rw-r--r--tests/uploader/test_entry.py (renamed from tests/qc_app/test_entry.py)0
-rw-r--r--tests/uploader/test_expression_data_pages.py (renamed from tests/qc_app/test_expression_data_pages.py)0
-rw-r--r--tests/uploader/test_files.py17
-rw-r--r--tests/uploader/test_parse.py (renamed from tests/qc_app/test_parse.py)4
-rw-r--r--tests/uploader/test_progress_indication.py (renamed from tests/qc_app/test_progress_indication.py)0
-rw-r--r--tests/uploader/test_results_page.py (renamed from tests/qc_app/test_results_page.py)0
-rw-r--r--tests/uploader/test_uploads_with_zip_files.py (renamed from tests/qc_app/test_uploads_with_zip_files.py)0
9 files changed, 21 insertions, 4 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index a39acf0..9012221 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -11,8 +11,8 @@ from redis import Redis
from functional_tools import take
-from qc_app import jobs, create_app
-from qc_app.jobs import JOBS_PREFIX
+from uploader import jobs, create_app
+from uploader.jobs import JOBS_PREFIX
from quality_control.errors import InvalidValue, DuplicateHeading
diff --git a/tests/qc_app/__init__.py b/tests/uploader/__init__.py
index e69de29..e69de29 100644
--- a/tests/qc_app/__init__.py
+++ b/tests/uploader/__init__.py
diff --git a/tests/qc_app/test_entry.py b/tests/uploader/test_entry.py
index 0c614a5..0c614a5 100644
--- a/tests/qc_app/test_entry.py
+++ b/tests/uploader/test_entry.py
diff --git a/tests/qc_app/test_expression_data_pages.py b/tests/uploader/test_expression_data_pages.py
index c2f7de1..c2f7de1 100644
--- a/tests/qc_app/test_expression_data_pages.py
+++ b/tests/uploader/test_expression_data_pages.py
diff --git a/tests/uploader/test_files.py b/tests/uploader/test_files.py
new file mode 100644
index 0000000..cb22fff
--- /dev/null
+++ b/tests/uploader/test_files.py
@@ -0,0 +1,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
diff --git a/tests/qc_app/test_parse.py b/tests/uploader/test_parse.py
index 3915a4d..076c47c 100644
--- a/tests/qc_app/test_parse.py
+++ b/tests/uploader/test_parse.py
@@ -4,7 +4,7 @@ import sys
import redis
import pytest
-from qc_app.jobs import job, jobsnamespace
+from uploader.jobs import job, jobsnamespace
from tests.conftest import uploadable_file_object
@@ -24,7 +24,7 @@ def test_parse_with_existing_uploaded_file(#pylint: disable=[too-many-arguments]
1. the system redirects to the job/parse status page
2. the job is placed on redis for processing
"""
- monkeypatch.setattr("qc_app.jobs.uuid4", lambda : job_id)
+ monkeypatch.setattr("uploader.jobs.uuid4", lambda : job_id)
# Upload a file
speciesid = 1
filename = "no_data_errors.tsv"
diff --git a/tests/qc_app/test_progress_indication.py b/tests/uploader/test_progress_indication.py
index 14a1050..14a1050 100644
--- a/tests/qc_app/test_progress_indication.py
+++ b/tests/uploader/test_progress_indication.py
diff --git a/tests/qc_app/test_results_page.py b/tests/uploader/test_results_page.py
index 8c8379f..8c8379f 100644
--- a/tests/qc_app/test_results_page.py
+++ b/tests/uploader/test_results_page.py
diff --git a/tests/qc_app/test_uploads_with_zip_files.py b/tests/uploader/test_uploads_with_zip_files.py
index 1506cfa..1506cfa 100644
--- a/tests/qc_app/test_uploads_with_zip_files.py
+++ b/tests/uploader/test_uploads_with_zip_files.py