From 7e4a732685b7012799bc3b72ea73d56cbfe704f6 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Fri, 6 Nov 2026 07:22:09 -0500 Subject: [PATCH] tests: use updated method name and re-run cassettes close #683 --- .../test_from_hgvs_coding_coordinates.yaml | 17 ------------- ...02464808)_(202559947_?)del-expected2].yaml | 25 ------------------- ...hgvs[NM_181798.1:c.1007G>T-expected7].yaml | 16 ++++++------ tests/extras/test_location_bounds.py | 6 ++--- 4 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 tests/extras/cassettes/test_from_hgvs_uncertain_range[NC_000002.12:g.(202377551_202464808)_(202559947_?)del-expected2].yaml diff --git a/tests/extras/cassettes/test_from_hgvs_coding_coordinates.yaml b/tests/extras/cassettes/test_from_hgvs_coding_coordinates.yaml index 7010f6b9..505971a0 100644 --- a/tests/extras/cassettes/test_from_hgvs_coding_coordinates.yaml +++ b/tests/extras/cassettes/test_from_hgvs_coding_coordinates.yaml @@ -1,21 +1,4 @@ interactions: -- request: - body: null - headers: {} - method: GET - uri: http://localhost:5000/seqrepo/1/metadata/refseq:NM_001331029.1 - response: - body: - string: "{\n \"added\": \"2016-08-24T05:03:40Z\",\n \"aliases\": [\n \"MD5:a8d7243ffeea4ade1dbc33613887693b\",\n - \ \"NCBI:NM_001331029.1\",\n \"refseq:NM_001331029.1\",\n \"NCBI:XM_017001344.1\",\n - \ \"refseq:XM_017001344.1\",\n \"SEGUID:qw9iIJ9BPdGZfypwQH7S3L2f9gI\",\n - \ \"SHA1:ab0f62209f413dd1997f2a70407ed2dcbd9ff602\",\n \"VMC:GS_MBIgVnoHFw34aFqNUVGM0zgjC3d-v8dK\",\n - \ \"sha512t24u:MBIgVnoHFw34aFqNUVGM0zgjC3d-v8dK\",\n \"ga4gh:SQ.MBIgVnoHFw34aFqNUVGM0zgjC3d-v8dK\"\n - \ ],\n \"alphabet\": \"ACGT\",\n \"length\": 11291\n}\n" - headers: {} - status: - code: 200 - message: OK - request: body: null headers: {} diff --git a/tests/extras/cassettes/test_from_hgvs_uncertain_range[NC_000002.12:g.(202377551_202464808)_(202559947_?)del-expected2].yaml b/tests/extras/cassettes/test_from_hgvs_uncertain_range[NC_000002.12:g.(202377551_202464808)_(202559947_?)del-expected2].yaml deleted file mode 100644 index 0f210533..00000000 --- a/tests/extras/cassettes/test_from_hgvs_uncertain_range[NC_000002.12:g.(202377551_202464808)_(202559947_?)del-expected2].yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: null - headers: {} - method: GET - uri: http://localhost:5000/seqrepo/1/metadata/refseq:NC_000002.12 - response: - body: - string: "{\n \"added\": \"2016-08-27T21:18:24Z\",\n \"aliases\": [\n \"GRCh38:2\",\n - \ \"GRCh38:chr2\",\n \"GRCh38.p1:2\",\n \"GRCh38.p1:chr2\",\n \"GRCh38.p10:2\",\n - \ \"GRCh38.p10:chr2\",\n \"GRCh38.p11:2\",\n \"GRCh38.p11:chr2\",\n - \ \"GRCh38.p12:2\",\n \"GRCh38.p12:chr2\",\n \"GRCh38.p2:2\",\n \"GRCh38.p2:chr2\",\n - \ \"GRCh38.p3:2\",\n \"GRCh38.p3:chr2\",\n \"GRCh38.p4:2\",\n \"GRCh38.p4:chr2\",\n - \ \"GRCh38.p5:2\",\n \"GRCh38.p5:chr2\",\n \"GRCh38.p6:2\",\n \"GRCh38.p6:chr2\",\n - \ \"GRCh38.p7:2\",\n \"GRCh38.p7:chr2\",\n \"GRCh38.p8:2\",\n \"GRCh38.p8:chr2\",\n - \ \"GRCh38.p9:2\",\n \"GRCh38.p9:chr2\",\n \"MD5:f98db672eb0993dcfdabafe2a882905c\",\n - \ \"NCBI:NC_000002.12\",\n \"refseq:NC_000002.12\",\n \"SEGUID:pBoFMQaDoXC+x2bJzzt0ZgzG7Yg\",\n - \ \"SHA1:a41a05310683a170bec766c9cf3b74660cc6ed88\",\n \"VMC:GS_pnAqCRBrTsUoBghSD1yp_jXWSmlbdh4g\",\n - \ \"sha512t24u:pnAqCRBrTsUoBghSD1yp_jXWSmlbdh4g\",\n \"ga4gh:SQ.pnAqCRBrTsUoBghSD1yp_jXWSmlbdh4g\"\n - \ ],\n \"alphabet\": \"ACGKMNRTWY\",\n \"length\": 242193529\n}\n" - headers: {} - status: - code: 200 - message: OK -version: 1 diff --git a/tests/extras/cassettes/test_hgvs[NM_181798.1:c.1007G>T-expected7].yaml b/tests/extras/cassettes/test_hgvs[NM_181798.1:c.1007G>T-expected7].yaml index 7e39de58..20c3a261 100644 --- a/tests/extras/cassettes/test_hgvs[NM_181798.1:c.1007G>T-expected7].yaml +++ b/tests/extras/cassettes/test_hgvs[NM_181798.1:c.1007G>T-expected7].yaml @@ -67,13 +67,13 @@ interactions: body: null headers: {} method: GET - uri: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=NR_040711.1&rettype=fasta&seq_start=1263&seq_stop=1263&tool=bioutils&email=biocommons-dev@googlegroups.com + uri: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=NM_181798.1&rettype=fasta&seq_start=1263&seq_stop=1268&tool=bioutils&email=biocommons-dev@googlegroups.com response: body: - string: '>NR_040711.1:1263-1263 Homo sapiens potassium voltage-gated channel, - KQT-like subfamily, member 1 (KCNQ1), transcript variant 2, non-coding RNA + string: '>NM_181798.1:1263-1268 Homo sapiens potassium voltage-gated channel + subfamily Q member 1 (KCNQ1), transcript variant 2, mRNA - G + GTTCTG ' @@ -85,13 +85,13 @@ interactions: body: null headers: {} method: GET - uri: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=NM_181798.1&rettype=fasta&seq_start=1263&seq_stop=1268&tool=bioutils&email=biocommons-dev@googlegroups.com + uri: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=NR_040711.1&rettype=fasta&seq_start=1263&seq_stop=1263&tool=bioutils&email=biocommons-dev@googlegroups.com response: body: - string: '>NM_181798.1:1263-1268 Homo sapiens potassium voltage-gated channel - subfamily Q member 1 (KCNQ1), transcript variant 2, mRNA + string: '>NR_040711.1:1263-1263 Homo sapiens potassium voltage-gated channel, + KQT-like subfamily, member 1 (KCNQ1), transcript variant 2, non-coding RNA - GTTCTG + G ' diff --git a/tests/extras/test_location_bounds.py b/tests/extras/test_location_bounds.py index d40ecbcf..00a5ae91 100644 --- a/tests/extras/test_location_bounds.py +++ b/tests/extras/test_location_bounds.py @@ -166,7 +166,7 @@ def _bounds_msg(sequence_id: str, detail: str, seq_len: int) -> str: def test_out_of_bounds(request: pytest.FixtureRequest, case: dict) -> None: tlr = request.getfixturevalue(case["tlr_fixture"]) with pytest.raises(DataProxyValidationError, match=f"^{re.escape(case['msg'])}$"): - tlr.translate_from(case["var"], fmt=case["fmt"], **case.get("kwargs", {})) + tlr.to_vrs(case["var"], fmt=case["fmt"], **case.get("kwargs", {})) @pytest.mark.parametrize("case", start_after_end_cases, ids=lambda c: c["id"]) @@ -176,13 +176,13 @@ def test_start_after_end(request: pytest.FixtureRequest, case: dict) -> None: with pytest.raises( DataProxyValidationError, match=f"^{re.escape(START_AFTER_END_MSG)}$" ): - tlr.translate_from(case["var"], fmt="hgvs") + tlr.to_vrs(case["var"], fmt="hgvs") @pytest.mark.parametrize("case", in_bounds_cases, ids=lambda c: c["id"]) @pytest.mark.vcr def test_in_bounds(request: pytest.FixtureRequest, case: dict) -> None: tlr = request.getfixturevalue(case["tlr_fixture"]) - location = tlr.translate_from(case["var"], fmt=case["fmt"]).location.model_dump() + location = tlr.to_vrs(case["var"], fmt=case["fmt"]).location.model_dump() expected_location = case["expected_location"] assert {k: location[k] for k in expected_location} == expected_location