diff --git a/mne_bids/tests/test_mne_bids.py b/mne_bids/tests/test_mne_bids.py index 7f112a4c29..8bbf454053 100644 --- a/mne_bids/tests/test_mne_bids.py +++ b/mne_bids/tests/test_mne_bids.py @@ -20,7 +20,7 @@ from mne.utils import _TempDir, run_subprocess from mne.io.constants import FIFF -from mne_bids import raw_to_bids, make_bids_filename +from mne_bids import write_raw_bids, make_bids_filename base_path = op.join(op.dirname(mne.__file__), 'io') subject_id = '01' @@ -53,10 +53,12 @@ def test_fif(): events_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw-eve.fif') - raw_to_bids(subject_id=subject_id, session_id=session_id, run=run, - acquisition=acq, task=task, raw_file=raw_fname, - events_data=events_fname, output_path=output_path, - event_id=event_id, overwrite=True) + raw = mne.io.read_raw_fif(raw_fname) + bids_fname = make_bids_filename( + subject_id=subject_id, session_id=session_id, run=run, acquisition=acq, + task=task, suffix='meg.fif') + write_raw_bids(raw, bids_fname, output_path, events_data=events_fname, + event_id=event_id, overwrite=True) # give the raw object some fake participant data raw = mne.io.read_raw_fif(raw_fname) @@ -66,10 +68,10 @@ def test_fif(): data_path2 = _TempDir() raw_fname2 = op.join(data_path2, 'sample_audvis_raw.fif') raw.save(raw_fname2) - raw_to_bids(subject_id=subject_id2, run=run, task=task, acquisition=acq, - session_id=session_id, raw_file=raw_fname2, - events_data=events_fname, output_path=output_path, - event_id=event_id, overwrite=True) + + bids_fname = bids_fname.replace(subject_id, subject_id2) + write_raw_bids(raw, bids_fname, output_path, event_data=events_fname, + event_id=event_id, overwrite=True) cmd = ['bids-validator', output_path] run_subprocess(cmd, shell=shell)