Skip to content

Commit

Permalink
update fusor version, coolseqtool version, and tests due to those upd…
Browse files Browse the repository at this point in the history
…ates + pydantic
  • Loading branch information
katiestahl committed Jul 10, 2024
1 parent 7838e83 commit bd2f5e9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 37 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ decorator==5.1.1
executing==1.2.0
fake-useragent==1.1.3
fastapi==0.100.0
fusor==0.0.30.dev1
fusor==0.1.0
ga4gh.vrs==0.8.4
ga4gh.vrsatile.pydantic==0.2.0
gene-normalizer==0.1.40-dev1
Expand Down
2 changes: 1 addition & 1 deletion server/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install_requires =
fastapi >= 0.72.0
aiofiles
asyncpg
fusor ~= 0.0.30-dev1
fusor ~= 0.1.0
sqlparse >= 0.4.2
urllib3 >= 1.26.5
click
Expand Down
12 changes: 6 additions & 6 deletions server/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def tpm3_tx_g_element(tpm3_descriptor):
"type": "TranscriptSegmentElement",
"transcript": "refseq:NM_152263.4",
"exon_start": 6,
"exon_start_offset": 5,
"exon_start_offset": 72,
"exon_end": 6,
"exon_end_offset": -70,
"exon_end_offset": -5,
"gene_descriptor": tpm3_descriptor,
"element_genomic_start": {
"id": "fusor.location_descriptor:NC_000001.11",
Expand All @@ -195,8 +195,8 @@ def tpm3_tx_g_element(tpm3_descriptor):
"sequence_id": "refseq:NC_000001.11",
"interval": {
"type": "SequenceInterval",
"start": {"type": "Number", "value": 154171483},
"end": {"type": "Number", "value": 154171484},
"start": {"type": "Number", "value": 154171416},
"end": {"type": "Number", "value": 154171417},
},
},
},
Expand All @@ -209,8 +209,8 @@ def tpm3_tx_g_element(tpm3_descriptor):
"sequence_id": "refseq:NC_000001.11",
"interval": {
"type": "SequenceInterval",
"start": {"type": "Number", "value": 154171482},
"end": {"type": "Number", "value": 154171483},
"start": {"type": "Number", "value": 154171417},
"end": {"type": "Number", "value": 154171418},
},
},
},
Expand Down
21 changes: 1 addition & 20 deletions server/tests/integration/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,25 +187,6 @@ async def test_build_tx_segment_ect(
)


@pytest.mark.asyncio
async def test_build_segment_gct(
check_response, check_tx_element_response, tpm3_tx_t_element
):
"""Test correct functioning of transcript segment element construction using
genomic coordinates and transcript.
"""
await check_response(
"/api/construct/structural_element/tx_segment_gct?transcript=NM_152263.4&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501
{"element": tpm3_tx_t_element},
check_tx_element_response,
)
await check_response(
"/api/construct/structural_element/tx_segment_gct?transcript=refseq%3ANM_152263.4&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501
{"element": tpm3_tx_t_element},
check_tx_element_response,
)


@pytest.mark.asyncio
async def test_build_segment_gcg(
check_response, check_tx_element_response, tpm3_tx_g_element
Expand All @@ -214,7 +195,7 @@ async def test_build_segment_gcg(
genomic coordinates and gene name.
"""
await check_response(
"/api/construct/structural_element/tx_segment_gcg?gene=TPM3&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501
"/api/construct/structural_element/tx_segment_gcg?gene=TPM3&chromosome=NC_000001.11&transcript=NM_152263.4&start=154171416&end=154171417&strand=-", # noqa: E501
{"element": tpm3_tx_g_element},
check_tx_element_response,
)
Expand Down
2 changes: 2 additions & 0 deletions server/tests/integration/test_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ async def test_normalize_gene(async_client: AsyncClient):
response = await async_client.get("/api/lookup/gene?term=sdfliuwer")
assert response.status_code == 200
assert response.json() == {
"cased": "",
"symbol": "",
"term": "sdfliuwer",
"warnings": ["Lookup of gene term sdfliuwer failed."],
}
12 changes: 3 additions & 9 deletions server/tests/integration/test_nomenclature.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ async def test_tx_segment_nomenclature(
"/api/nomenclature/transcript_segment?first=true&last=false", json=epcam_invalid
)
assert response.status_code == 200
assert response.json().get("warnings", []) == [
"1 validation error for TranscriptSegmentElement\ntranscript\n field required (type=value_error.missing)" # noqa: E501
]
assert "field required" in response.json().get("warnings", [])[0].lower()


@pytest.mark.asyncio
Expand All @@ -196,9 +194,7 @@ async def test_gene_element_nomenclature(
json={"type": "GeneElement", "associated_gene": {"id": "hgnc:427"}},
)
assert response.status_code == 200
assert response.json().get("warnings", []) == [
"2 validation errors for GeneElement\ngene_descriptor\n field required (type=value_error.missing)\nassociated_gene\n extra fields not permitted (type=value_error.extra)" # noqa: E501
]
assert "field required" in response.json().get("warnings", [])[0].lower()


@pytest.mark.asyncio
Expand Down Expand Up @@ -234,9 +230,7 @@ async def test_templated_sequence_nomenclature(
},
)
assert response.status_code == 200
assert response.json().get("warnings", []) == [
"1 validation error for TemplatedSequenceElement\nstrand\n field required (type=value_error.missing)" # noqa: E501
]
assert "field required" in response.json().get("warnings", [])[0].lower()


@pytest.mark.asyncio
Expand Down

0 comments on commit bd2f5e9

Please sign in to comment.