Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/extras/test_cnv_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@


@pytest.fixture(scope="module")
def tlr(rest_dataproxy):
def tlr(dataproxy):
"""Fixture providing a CnvTranslator backed by local SeqRepoDataProxy.

NC_000013.11 is present in the local test SeqRepo, so using dataproxy allows
these tests to run standalone and in any test order without VCR cassettes.
"""
return CnvTranslator(
data_proxy=rest_dataproxy,
data_proxy=dataproxy,
default_assembly_name="GRCh38",
identify=True,
)
Expand Down Expand Up @@ -102,7 +107,6 @@ def tlr(rest_dataproxy):


@pytest.mark.parametrize(("hgvsexpr", "copy_change", "expected"), from_hgvs_cx_tests)
@pytest.mark.vcr
def test_from_hgvs_cx(tlr, hgvsexpr, copy_change, expected):
"""Test that _from_hgvs works correctly for copy number change"""
cx = tlr._from_hgvs(hgvsexpr, copy_change=copy_change)
Expand Down Expand Up @@ -156,14 +160,12 @@ def test_from_hgvs_cx(tlr, hgvsexpr, copy_change, expected):


@pytest.mark.parametrize(("hgvsexpr", "copies", "expected"), from_hgvs_cn_tests)
@pytest.mark.vcr
def test_from_hgvs_cn(tlr, hgvsexpr, copies, expected):
"""Test that _from_hgvs works correctly for copy number count"""
cn = tlr._from_hgvs(hgvsexpr, copies=copies)
assert cn.model_dump(exclude_none=True) == expected


@pytest.mark.vcr
def test_from_hgvs_cn_copies_zero(tlr):
"""Test that copies=0 produces CopyNumberCount, not CopyNumberChange.

Expand Down