aboutsummaryrefslogtreecommitdiff
path: root/tests/qc/test_parsing.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-05-18 17:34:55 +0300
committerFrederick Muriuki Muriithi2022-05-18 17:36:16 +0300
commit347ca2fe50225b4736e69bb86d8b278818be40ac (patch)
treedf7fcab96bb0dfc44633e93b5875451dfd1af305 /tests/qc/test_parsing.py
parent8f32812ce73193366ee00d883fd427c830f5a8e9 (diff)
downloadgn-uploader-347ca2fe50225b4736e69bb86d8b278818be40ac.tar.gz
Remove obsoleted code. Fix linting errors.
Remove the old code that relied on exceptions to parse errors in the uploaded files.
Diffstat (limited to 'tests/qc/test_parsing.py')
-rw-r--r--tests/qc/test_parsing.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/tests/qc/test_parsing.py b/tests/qc/test_parsing.py
deleted file mode 100644
index 41739ad..0000000
--- a/tests/qc/test_parsing.py
+++ /dev/null
@@ -1,53 +0,0 @@
-"""Test the parsing of the files"""
-import pytest
-
-from quality_control.errors import ParseError
-from quality_control.parsing import FileType, parse_file
-
-@pytest.mark.parametrize(
- "filepath,filetype",
- (("tests/test_data/average_crlf.tsv", FileType.STANDARD_ERROR),
- ("tests/test_data/average_error_at_end_200MB.tsv",
- FileType.STANDARD_ERROR),
- ("tests/test_data/average.tsv", FileType.STANDARD_ERROR),
- ("tests/test_data/standarderror_1_error_at_end.tsv", FileType.AVERAGE),
- ("tests/test_data/standarderror.tsv", FileType.AVERAGE),
- ("tests/test_data/duplicated_headers_no_data_errors.tsv",
- FileType.STANDARD_ERROR),))
-def test_parse_file_fails_with_wrong_filetype_declaration(filepath, filetype, strains):
- """Check that parsing fails if the wrong file type is declared"""
- with pytest.raises(ParseError):
- for line in parse_file(filepath, filetype, strains): # pylint: disable=[unused-variable]
- pass
-
-@pytest.mark.parametrize(
- "filepath,filetype",
- (("tests/test_data/no_data_errors.tsv", FileType.AVERAGE),))
-def test_parse_file_passes_with_valid_files(filepath, filetype, strains):
- """Check that parsing succeeds with valid files"""
- for line in parse_file(filepath, filetype, strains):
- assert bool(line)
-
-@pytest.mark.slow
-@pytest.mark.parametrize(
- "filepath,filetype",
- (("tests/test_data/average_large_no_errors.tsv", FileType.AVERAGE),
- # ("tests/test_data/average_no_errors.tsv", FileType.AVERAGE),
- # ("tests/test_data/standarderror_no_errors.tsv", FileType.STANDARD_ERROR),
- ))
-def test_parse_file_works_with_large_files(filepath, filetype, strains):
- """Check that parsing succeeds even with large files."""
- for line in parse_file(filepath, filetype, strains):
- assert bool(line)
-
-@pytest.mark.slow
-@pytest.mark.parametrize(
- "filepath,filetype",
- (("tests/test_data/average_error_at_end_200MB.tsv", FileType.AVERAGE),
- ("tests/test_data/standarderror_1_error_at_end.tsv", FileType.STANDARD_ERROR),
- ("tests/test_data/duplicated_headers_no_data_errors.tsv", FileType.AVERAGE)))
-def test_parse_file_raises_exception_on_error_in_file(filepath, filetype, strains):
- "Check that parsing fails if any error is found in a file"
- with pytest.raises(ParseError):
- for line in parse_file(filepath, filetype, strains): # pylint: disable=[unused-variable]
- pass