forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5ff242
commit 6b52d6d
Showing
1 changed file
with
26 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,44 @@ | ||
import pytest | ||
|
||
from galaxy.datatypes.sequence import ( | ||
Fasta, | ||
FastqSanger, | ||
FastqSolexa, | ||
) | ||
from .util import get_dataset | ||
from .util import ( | ||
get_dataset, | ||
MockDatasetDataset, | ||
) | ||
|
||
|
||
def test_fasta_set_meta(): | ||
@pytest.mark.parametrize( | ||
"input_file", | ||
[ | ||
"1.fasta", | ||
"1.fasta.gz", | ||
], | ||
) | ||
def test_fasta_set_meta(input_file): | ||
b = Fasta() | ||
with get_dataset("1.fasta") as dataset: | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 2 | ||
assert dataset.metadata.sequences == 1 | ||
|
||
|
||
def test_fastagz_set_meta(): | ||
b = Fasta() | ||
with get_dataset("1.fasta.gz") as dataset: | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 2 | ||
assert dataset.metadata.sequences == 1 | ||
|
||
|
||
def test_fastqsanger_set_meta(): | ||
b = FastqSanger() | ||
@pytest.mark.parametrize( | ||
"fastq_type,input_file", | ||
[ | ||
[FastqSanger, "1.fastqsanger"], | ||
[FastqSanger, "1.fastqsanger.gz"], | ||
[FastqSanger, "1.fastqsanger.bz2"], | ||
[FastqSolexa, "1.fastqssolexa"], | ||
], | ||
) | ||
def test_fastqsanger_set_meta(fastq_type, input_file): | ||
b = fastq_type() | ||
with get_dataset("1.fastqsanger") as dataset: | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 8 | ||
assert dataset.metadata.sequences == 2 | ||
|
||
|
||
def test_fastqsangergz_set_meta(): | ||
b = FastqSanger() | ||
with get_dataset("1.fastqsanger.gz") as dataset: | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 8 | ||
assert dataset.metadata.sequences == 2 | ||
|
||
|
||
def test_fastqsangerbz2_set_meta(): | ||
b = FastqSanger() | ||
with get_dataset("1.fastqsanger.bz2") as dataset: | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 8 | ||
assert dataset.metadata.sequences == 2 | ||
|
||
|
||
def test_fastqsolexa_set_meta(): | ||
b = FastqSolexa() | ||
with get_dataset("1.fastqsolexa") as dataset: | ||
dataset.dataset = MockDatasetDataset(dataset.get_file_name()) | ||
b.set_meta(dataset=dataset) | ||
assert dataset.metadata.data_lines == 8 | ||
assert dataset.metadata.sequences == 2 |