Skip to content

Commit

Permalink
TST, WIP: Make it break
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-huberty committed Sep 6, 2024
1 parent 8e2415f commit d067511
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nibabies/utils/tests/test_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_sidecar(tsv_file: Path, units) -> None:
age = {'age': [4, 4, 4]}
age_weeks = {'age_weeks': [4, 8, 12]}
age_months = {'age_months': [3, 6, 9]}
age_years = {'age_years': [1, 1, 2]}
age_years = {'age_years': [1, 2, 1, 2, 1, 2]} # Will be used for longitudinal TSV


@pytest.mark.parametrize(
Expand All @@ -42,7 +42,12 @@ def create_sidecar(tsv_file: Path, units) -> None:
def test_get_age_from_tsv(tmp_path, idx_col, idx_val, data, sidecar, expected):
tsv_file = tmp_path / 'test-age-parsing.tsv'
base = {}
if idx_col is not None:
if idx_col == "participant_id" and idx_val == "x3":
# Longitudinal study TSV with both participant_id and session columns
base['participant_id'] = ["x1", "x1", "x2", "x2", "x3", "x3"]
base['session'] = ["v1", "v2", "v1", "v2", "v1", "v2"]
assert len(base['participant_id']) == len(data['age_years'])
elif idx_col is not None:
base[idx_col] = ['x1', 'x2', 'x3']
create_tsv({**base, **data}, tsv_file)

Expand Down

0 comments on commit d067511

Please sign in to comment.