Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen committed Jul 3, 2024
1 parent c576e34 commit 8928e63
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/unittests/iotools/utils/test_pipeline_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pandas as pd
import pytest
from pandas.testing import assert_frame_equal

from clinica.iotools.utils.pipeline_handling import PipelineNameForMetricExtraction

Expand Down Expand Up @@ -268,18 +269,25 @@ def test_extract_metrics_from_pipeline_errors(tmp_path):
)


def test_extract_metrics_from_pipeline(tmp_path):
def test_extract_metrics_from_pipeline_empty(tmp_path):
from clinica.iotools.utils.pipeline_handling import _extract_metrics_from_pipeline

(tmp_path / "groups").mkdir()
df = pd.DataFrame([["bar", "bar"]], columns=["participant_id", "session_id"])
assert _extract_metrics_from_pipeline(
x, y = _extract_metrics_from_pipeline(
tmp_path, df, ["metrics"], PipelineNameForMetricExtraction.T1_VOLUME
) == (
df,
None,
)
(tmp_path / "groups" / "UnitTest").mkdir()
assert_frame_equal(
x, pd.DataFrame([["bar", "bar"]], columns=["participant_id", "session_id"])
)
assert y.empty


def test_extract_metrics_from_pipeline(tmp_path):
from clinica.iotools.utils.pipeline_handling import _extract_metrics_from_pipeline

(tmp_path / "groups" / "UnitTest").mkdir(parents=True)
df = pd.DataFrame([["bar", "bar"]], columns=["participant_id", "session_id"])
x, y = _extract_metrics_from_pipeline(
tmp_path, df, ["metrics"], PipelineNameForMetricExtraction.T1_VOLUME
)
Expand Down

0 comments on commit 8928e63

Please sign in to comment.