Skip to content

Commit

Permalink
tests: add getSeries test
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Feb 18, 2024
1 parent c14bd6f commit 51f19e8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_nbia_series_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def nbia_collections_by_colMoldality(nbia_client: NBIAClient, nbia_patients_df):
return nbia_collections_by_colMoldality


@pytest.fixture(scope="session")
def nbia_series(nbia_client):
series = "1.3.6.1.4.1.14519.5.2.1.9203.4004.652695091345533290618011349477"
series_df = nbia_client.getSeries(SeriesInstanceUID=series, return_type="dataframe")
return series_df


def test_tcga_studies(tcga_studies):

assert isinstance(tcga_studies, list)
Expand Down Expand Up @@ -79,3 +86,19 @@ def test_getNewPatients(nbia_patients_df):
def test_nbia_collections_by_colMoldality(nbia_collections_by_colMoldality):
assert isinstance(nbia_collections_by_colMoldality, list)
assert len(nbia_collections_by_colMoldality) > 1


def test_getSeries(nbia_series):
assert isinstance(nbia_series, pd.DataFrame)
assert len(nbia_series) == 1
expected_cols: list[str] = [
"SeriesInstanceUID",
"StudyInstanceUID",
"Modality",
"SeriesDescription",
"BodyPartExamined",
"Collection",
"PatientID",
"SeriesNumber",
]
assert all(col in nbia_series.columns for col in expected_cols)

0 comments on commit 51f19e8

Please sign in to comment.