-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some compression-related tests to separate module
- Loading branch information
Showing
2 changed files
with
67 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import pytest | ||
|
||
from cutadapt.cli import main | ||
from utils import datapath | ||
|
||
|
||
def test_gz_multiblock(run): | ||
"""compressed gz file with multiple blocks (created by concatenating two .gz files)""" | ||
run("-b TTAGACATATCTCCGTCG", "small.fastq", "multiblock.fastq.gz") | ||
|
||
|
||
def test_extensiontxtgz(run): | ||
"""automatic recognition of "_sequence.txt.gz" extension""" | ||
run("-b TTAGACATATCTCCGTCG", "s_1_sequence.txt", "s_1_sequence.txt.gz") | ||
|
||
|
||
def test_compressed_fasta(run): | ||
run("", "simple.fasta", "simple.fasta.gz") | ||
|
||
|
||
def test_write_compressed_fastq(cores, tmp_path): | ||
main( | ||
[ | ||
"--cores", | ||
str(cores), | ||
"-o", | ||
str(tmp_path / "out.fastq.gz"), | ||
datapath("small.fastq"), | ||
] | ||
) | ||
|
||
|
||
@pytest.mark.parametrize("extension", ["bz2", "xz", "gz"]) | ||
def test_compressed_output(tmp_path, cores, extension): | ||
out_path = str(tmp_path / ("small.fastq." + extension)) | ||
params = [ | ||
"--cores", | ||
str(cores), | ||
"-a", | ||
"TTAGACATATCTCCGTCG", | ||
"-o", | ||
out_path, | ||
datapath("small.fastq"), | ||
] | ||
main(params) | ||
|
||
|
||
def test_bzip2_multiblock(run): | ||
run("-b TTAGACATATCTCCGTCG", "small.fastq", "multiblock.fastq.bz2") | ||
|
||
|
||
def test_xz(run): | ||
run("-b TTAGACATATCTCCGTCG", "small.fastq", "small.fastq.xz") | ||
|
||
|
||
def test_bzip2_input(run, cores): | ||
run( | ||
["--cores", str(cores), "-a", "TTAGACATATCTCCGTCG"], | ||
"small.fastq", | ||
"small.fastq.bz2", | ||
) | ||
|
||
|
||
def test_underscore(run): | ||
"""File name ending in _fastq.gz (issue #275)""" | ||
run("-b TTAGACATATCTCCGTCG", "small.fastq", "underscore_fastq.gz") |