def test_raw_to_bids(tmp_path): """Test mne_bids raw_to_bids.""" output_path = str(tmp_path) data_path = testing.data_path() raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw.fif') # Check that help is printed check_usage(mne_bids_raw_to_bids) # Should work with ArgvSetter(('--subject_id', subject_id, '--task', task, '--raw', raw_fname, '--bids_root', output_path, '--line_freq', 60)): mne_bids_raw_to_bids.run() # Test line_freq == 'None' with ArgvSetter(('--subject_id', subject_id, '--task', task, '--raw', raw_fname, '--bids_root', output_path, '--line_freq', 'None', '--overwrite', 1)): mne_bids_raw_to_bids.run() # Test EDF files as well edf_data_path = op.join(base_path, 'edf', 'tests', 'data') edf_fname = op.join(edf_data_path, 'test.edf') with ArgvSetter(('--subject_id', subject_id, '--task', task, '--raw', edf_fname, '--bids_root', output_path, '--line_freq', 60)): mne_bids_raw_to_bids.run() # Too few input args with pytest.raises(SystemExit): with ArgvSetter(('--subject_id', subject_id)): mne_bids_cp.run()
def test_cp(tmp_path): """Test mne_bids cp.""" output_path = str(tmp_path) data_path = op.join(base_path, 'brainvision', 'tests', 'data') raw_fname = op.join(data_path, 'test.vhdr') outname = op.join(output_path, 'test2.vhdr') # Check that help is printed check_usage(mne_bids_cp) # Should work with ArgvSetter(('--input', raw_fname, '--output', outname)): mne_bids_cp.run() # Too few input args with pytest.raises(SystemExit): with ArgvSetter(('--input', raw_fname)): mne_bids_cp.run()
def test_raw_to_bids(tmpdir): """Test mne_bids raw_to_bids.""" output_path = str(tmpdir) data_path = testing.data_path() raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw.fif') # Check that help is printed check_usage(mne_bids_raw_to_bids) # Should work with ArgvSetter(('--subject_id', subject_id, '--task', task, '--raw', raw_fname, '--bids_root', output_path)): mne_bids_raw_to_bids.run() # Too few input args with pytest.raises(SystemExit): with ArgvSetter(('--subject_id', subject_id)): mne_bids_cp.run()