From 8507647aefff62ec8770247c27ac7255dbc2367c Mon Sep 17 00:00:00 2001 From: Aaron Earle-Richardson Date: Fri, 23 Aug 2024 11:32:36 -0400 Subject: [PATCH] added alphanumeric subject to participants testing --- mne_bids/tests/test_write.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mne_bids/tests/test_write.py b/mne_bids/tests/test_write.py index 629c7c422..ee01eaeca 100644 --- a/mne_bids/tests/test_write.py +++ b/mne_bids/tests/test_write.py @@ -258,11 +258,17 @@ def test_write_participants(_bids_validate, tmp_path): write_raw_bids(raw, bids_path, verbose=False) data = _from_tsv(participants_tsv) + # write an alphanumeric subject + bids_path.update(subject="D04") + write_raw_bids(raw, bids_path, verbose=False) + data = _from_tsv(participants_tsv) + # hand should have been written properly with now 'n/a' for sub-01 and # sub-03, but 'L' for sub-03 assert data["hand"][data["participant_id"].index("sub-01")] == "n/a" assert data["hand"][data["participant_id"].index("sub-02")] == "n/a" assert data["hand"][data["participant_id"].index("sub-03")] == "L" + assert data["hand"][data["participant_id"].index("sub-D04")] == "L" # check to make sure participant data is overwritten, but keeps the fields # if there are extra fields that were user defined