diff options
Diffstat (limited to 'tests/qc')
-rw-r--r-- | tests/qc/test_error_collection.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/qc/test_error_collection.py b/tests/qc/test_error_collection.py index 3a26d9c..466f455 100644 --- a/tests/qc/test_error_collection.py +++ b/tests/qc/test_error_collection.py @@ -1,6 +1,7 @@ import pytest from quality_control.parsing import take, FileType, parse_errors +from quality_control.parsing import collect_errors @pytest.mark.slow @pytest.mark.parametrize( @@ -37,3 +38,21 @@ def test_take(sample, num, expected): taken = take(sample, num) assert len(taken) <= num assert taken == expected + + +## ================================================== + +@pytest.mark.slow +@pytest.mark.parametrize( + "filepath,filetype,count", + (("tests/test_data/average_crlf.tsv", FileType.AVERAGE, 10), + ("tests/test_data/average_error_at_end_200MB.tsv", FileType.AVERAGE, + 20), + ("tests/test_data/average.tsv", FileType.AVERAGE, 5), + ("tests/test_data/standarderror_1_error_at_end.tsv", + FileType.STANDARD_ERROR, 13), + ("tests/test_data/standarderror.tsv", FileType.STANDARD_ERROR, 9), + ("tests/test_data/duplicated_headers_no_data_errors.tsv", + FileType.AVERAGE, 10))) +def test_collect_errors(filepath, filetype, strains, count): + assert len(collect_errors(filepath, filetype, strains, count)) <= count |