Skip to content

Commit

Permalink
fix tests with updated (consistent) app util api
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmarzouk committed Nov 9, 2023
1 parent a4b3f76 commit 91f23f1
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions tests/units/test_app_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_pipeline_processing_genome_reference(mock_genome_dir):

selection_string = "{} - Ensembl release {}".format(assembly, release)

output = PipelineUIProcessing.genome_reference(selection_string)
condition, output = PipelineUIProcessing.genome_reference(selection_string)

assert isinstance(output, GenomePaths)
assert output.fasta.name.endswith(".fa")
Expand All @@ -139,11 +139,12 @@ def test_pipeline_processing_annotated_mutations():
with TemporaryFiles.tmp_in_dir(
Directories.app_annotated_inputs(), "anno"
) as c:
assert (
PipelineUIProcessing.annotated_mutations(c._pass_ext.name)
== c._pass_ext
condition, processed_option = PipelineUIProcessing.annotated_mutations(
c._pass_ext.name
)

assert processed_option == c._pass_ext

with pytest.raises(KeyError):
PipelineUIProcessing.annotated_mutations(c._fail_ext.name)

Expand All @@ -152,18 +153,24 @@ def test_pipeline_processing_immunopeptidome():
with TemporaryFiles.tmp_in_dir(
Directories.app_immunopeptidomes(), "bed"
) as c:
assert (
PipelineUIProcessing.immunopeptidome(c._pass_ext.name)
== c._pass_ext
)
(
condition,
processed_immunopeptidome,
) = PipelineUIProcessing.immunopeptidome(c._pass_ext.name)

assert processed_immunopeptidome == c._pass_ext

with pytest.raises(KeyError):
PipelineUIProcessing.immunopeptidome(c._fail_ext.name)


def test_pipeline_processing_substitution_method():
assert PipelineUIProcessing.substitution_method("SSB192") == 192
assert PipelineUIProcessing.substitution_method("SSB7") == 7
condition, processed_192 = PipelineUIProcessing.substitution_method(
"SSB192"
)
assert processed_192 == 192
condition, processed_7 = PipelineUIProcessing.substitution_method("SSB7")
assert processed_7 == 7

with pytest.raises(KeyError):
PipelineUIProcessing.substitution_method("SSB000")
Expand All @@ -180,7 +187,8 @@ def test_pipeline_processing_job_name():
mock_dir = Path("/just/for/pytest")
os.environ[cache_key] = mock_dir.as_posix()
job_name = "soprano"
assert PipelineUIProcessing.job_name(job_name) == mock_dir / job_name
condition, processed_name = PipelineUIProcessing.job_name(job_name)
assert processed_name == mock_dir / job_name
finally:
os.environ[cache_key] = _soprano_cache

Expand Down

0 comments on commit 91f23f1

Please sign in to comment.