Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Jan 3, 2025
1 parent a4d09f9 commit 0718a49
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Provide utilities for tests."""

from pathlib import Path

DATA_DIR = Path(__file__).resolve().parents[1] / "evidence" / "data"
14 changes: 8 additions & 6 deletions tests/data_sources/test_cancer_hotspots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import pytest
from evidence.data_sources import CancerHotspots
from tests.conftest import DATA_DIR


@pytest.fixture(scope="module")
def cancer_hotspots():
"""Create test fixture for cancer hotspots class"""
return CancerHotspots()
globbed = (DATA_DIR / "cancer_hotspots").glob("cancer_hotspots_*.json")
return CancerHotspots(transformed_data_path=sorted(globbed)[-1])


@pytest.fixture(scope="module")
Expand All @@ -32,7 +34,7 @@ def check_source_meta(response):
def test_mutation_hotspots(cancer_hotspots, braf_v600e):
"""Test that mutation_hotspots method works correctly."""
resp = cancer_hotspots.mutation_hotspots(
"ga4gh:VA.mo-SCo1oC_8rUioVymmrlDjwewWzJUdt"
"ga4gh:VA.urVNVupVvzqE57gZFBu6vsAFScIBNojG"
)
assert resp.data == {
"variation": "BRAF N486_A489delinsK",
Expand All @@ -44,7 +46,7 @@ def test_mutation_hotspots(cancer_hotspots, braf_v600e):
}

resp = cancer_hotspots.mutation_hotspots(
"ga4gh:VA.qiBmeiaWQpVa-NQbBk-tRb29arFXHlII"
"ga4gh:VA.iKBIyhCE-3Cnh5XJpVNZ4t0Ju8Ov8Ine"
)
assert resp.data == {
"variation": "BRAF N486_P490del",
Expand All @@ -56,7 +58,7 @@ def test_mutation_hotspots(cancer_hotspots, braf_v600e):
}

resp = cancer_hotspots.mutation_hotspots(
"ga4gh:VA.4Wr6-Pw1TiTDxvYTSthJHz0sl52wb7Hq"
"ga4gh:VA.uIzxca0MnfZ1ni3NYNkvNh6Isw-5QXG9"
)
assert resp.data == {
"variation": "TP53 I255del",
Expand All @@ -68,7 +70,7 @@ def test_mutation_hotspots(cancer_hotspots, braf_v600e):
}

resp = cancer_hotspots.mutation_hotspots(
"ga4gh:VA.0rVaYwX7S_-NenW_WQ5e7JoHQFkscWUS"
"ga4gh:VA.AM5oy_X7xBxJmWyUPJ0ZSLpRaTgu2kHt"
)
assert resp.data == {
"variation": "CEBPA T310_Q311insKQNP",
Expand All @@ -80,7 +82,7 @@ def test_mutation_hotspots(cancer_hotspots, braf_v600e):
}

resp = cancer_hotspots.mutation_hotspots(
vrs_variation_id="ga4gh:VA.4XBXAxSAk-WyAu5H0S1-plrk_SCTW1PO"
vrs_variation_id="ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L"
).model_dump(by_alias=True)
assert resp["_id"] == "normalize.evidence:92f3db383a79d855323a71d65d860ec3"
assert resp["data"] == braf_v600e
Expand Down
9 changes: 8 additions & 1 deletion tests/data_sources/test_cbioportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

import pytest
from evidence.data_sources import CBioPortal
from tests.conftest import DATA_DIR


@pytest.fixture(scope="module")
def cbioportal():
"""Create test fixture for cbioportal class"""
return CBioPortal()
cbioportal_data_dir = DATA_DIR / "cbioportal"
return CBioPortal(
transformed_mutations_data_path=cbioportal_data_dir
/ "msk_impact_2017_mutations.csv",
transformed_case_lists_data_path=cbioportal_data_dir
/ "msk_impact_2017_case_lists.csv",
)


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 0718a49

Please sign in to comment.