Skip to content

Commit

Permalink
tests: add a few tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Feb 18, 2024
1 parent 67777ef commit 4cfd83f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
14 changes: 14 additions & 0 deletions tests/test_nbia_series_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ def tcga_series(nbia_client):
Collection="TCGA-KIRC", PatientID="TCGA-BP-4989"
)
return tcga_series


@pytest.fixture(scope="session")
def tcga_studies(nbia_client):
tcga_studies = nbia_client.getStudies(
Collection="TCGA-KIRC", PatientID="TCGA-BP-4989"
)
return tcga_studies


def test_tcga_studies(tcga_studies):

assert isinstance(tcga_studies, list)
assert len(tcga_studies) > 0
12 changes: 2 additions & 10 deletions tests/test_new_query_functionality.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import pytest
from nbiatoolkit import nbia

from src.nbiatoolkit import NBIAClient
from src.nbiatoolkit.auth import OAuth2
from src.nbiatoolkit.utils import *
Expand All @@ -13,12 +11,6 @@ def nbia_client():
return nbia_client


# @pytest.fixture(scope="session")
# def nbia_client_bad_username():
# nbia = NBIAClient(username="bad_username", password="bad_password")
# return nbia


@pytest.fixture(scope="session")
def tcga_collections(nbia_client):
tcga_collections = nbia_client.getCollections(prefix="TCGA")
Expand All @@ -37,15 +29,15 @@ def tcga_patients(nbia_client):


@pytest.fixture(scope="session")
def nbia_patients_df(nbia_client):
def nbia_patients_df(nbia_client: NBIAClient, tcga_patients):
nbia_patients_df = nbia_client.getNewPatients(
Collection="CMB-LCA", return_type="dataframe", Date="2022/12/06"
)
return nbia_patients_df


@pytest.fixture(scope="session")
def nbia_collections_by_colMoldality(nbia_client):
def nbia_collections_by_colMoldality(nbia_client: NBIAClient, nbia_patients_df):
nbia_collections_by_colMoldality = nbia_client.getPatientsByCollectionAndModality(
Collection="TCGA-KIRC", Modality="MR"
)
Expand Down

0 comments on commit 4cfd83f

Please sign in to comment.