Skip to content

Commit d8b77d1

Browse files
committed
test: update tests based on changes
1 parent 08704cf commit d8b77d1

2 files changed

Lines changed: 11 additions & 20 deletions

File tree

tests/fixtures/collect_files.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ def como_input_data_directory(request: SubRequest) -> Path:
8181

8282

8383
@pytest.fixture(params=["naiveB", "smB"])
84-
def packed_filepaths(sample_name: str) -> PackedFilepaths:
84+
def packed_filepaths(request: SubRequest) -> PackedFilepaths:
8585
return PackedFilepaths(
86-
sample_name=sample_name,
87-
fragment_size=Path(f"main/data/COMO_input/{sample_name}/fragmentSizes/{sample_name}_fragment_size.txt"),
88-
gene_count=Path(f"main/data/COMO_input/{sample_name}/geneCounts/{sample_name}.tab"),
89-
insert_size=Path(f"main/data/COMO_input/{sample_name}/insertSizes/{sample_name}_insert_size.txt"),
90-
layout=Path(f"main/data/COMO_input/{sample_name}/layouts/{sample_name}_layout.txt"),
91-
preparation_method=Path(f"main/data/COMO_input/{sample_name}/prepMethods/{sample_name}_prep_method.txt"),
92-
strandedness=Path(f"main/data/COMO_input/{sample_name}/strandedness/{sample_name}_strandedness.txt"),
86+
sample_name=request.param,
87+
fragment_size=Path(f"main/data/COMO_input/{request.param}/fragmentSizes/{request.param}_fragment_size.txt"),
88+
gene_count=Path(f"main/data/COMO_input/{request.param}/geneCounts/{request.param}.tab"),
89+
insert_size=Path(f"main/data/COMO_input/{request.param}/insertSizes/{request.param}_insert_size.txt"),
90+
layout=Path(f"main/data/COMO_input/{request.param}/layouts/{request.param}_layout.txt"),
91+
preparation_method=Path(f"main/data/COMO_input/{request.param}/prepMethods/{request.param}_prep_method.txt"),
92+
strandedness=Path(f"main/data/COMO_input/{request.param}/strandedness/{request.param}_strandedness.txt"),
9393
)

tests/unit/test_rnaseq_preprocess.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525

2626
class TestSTARInformation:
27-
valid_data = Path("main/data/COMO_input/naiveB/geneCounts/S1/naiveB_S1R1.tab").absolute()
28-
invalid_data = Path("main/data/COMO_input/naiveB/fragmentSizes/S1/naiveB_S1R1_fragment_size.txt").absolute()
27+
valid_data = Path("main/data/COMO_input/naiveB/geneCounts/S1/naiveB_S1R1.tab").resolve()
28+
invalid_data = Path("main/data/COMO_input/naiveB/fragmentSizes/S1/naiveB_S1R1_fragment_size.txt").resolve()
2929

3030
@pytest.mark.asyncio
3131
async def test_build_from_tab_valid_file(self):
@@ -40,7 +40,7 @@ async def test_build_from_tab_valid_file(self):
4040
@pytest.mark.asyncio
4141
async def test_build_from_tab_invalid_file(self):
4242
"""Validate error on invalid file."""
43-
with pytest.raises(ValueError, match="Invalid file format"):
43+
with pytest.raises(ValueError, match="Building STAR information requires a '.tab' file"):
4444
await _STARinformation.build_from_tab(TestSTARInformation.invalid_data)
4545

4646

@@ -80,12 +80,3 @@ def test_pack_filepaths(packed_filepaths: PackedFilepaths):
8080
assert packed_filepaths.sample_name in packed_filepaths.layout.as_posix()
8181
assert packed_filepaths.sample_name in packed_filepaths.preparation_method.as_posix()
8282
assert packed_filepaths.sample_name in packed_filepaths.strandedness.as_posix()
83-
84-
85-
@pytest.mark.asyncio
86-
async def test_process_standard_replicate(packed_filepaths: PackedFilepaths):
87-
await _process_standard_replicate(
88-
counts_file=packed_filepaths.gene_count,
89-
strand_file=packed_filepaths.strandedness,
90-
sample_name=packed_filepaths.sample_name,
91-
)

0 commit comments

Comments
 (0)