def test_mockclient():
 raw = mne.io.read_raw_fif(raw_fname, preload=True, verbose=False)
 picks = mne.pick_types(raw.info, meg='grad', eeg=False, eog=True, stim=True, exclude=raw.info['bads'])
 (event_id, tmin, tmax) = (1, (-0.2), 0.5)
 epochs = Epochs(raw, events[:7], event_id=event_id, tmin=tmin, tmax=tmax, picks=picks, baseline=(None, 0), preload=True)
 data = epochs.get_data()
 rt_client = MockRtClient(raw)
 rt_epochs = RtEpochs(rt_client, event_id, tmin, tmax, picks=picks, isi_max=0.5)
 rt_epochs.start()
 rt_client.send_data(rt_epochs, picks, tmin=0, tmax=10, buffer_size=1000)
 rt_data = rt_epochs.get_data()
 assert_true((rt_data.shape == data.shape))
 assert_array_equal(rt_data, data)

def test_mockclient ( ) : raw = mne . io . read_raw_fif ( raw_fname , preload = True , verbose = False ) picks = mne . pick_types ( raw . info , meg = 'grad' , eeg = False , eog = True , stim = True , exclude = raw . info [ 'bads' ] ) ( event_id , tmin , tmax ) = ( 1 , ( - 0.2 ) , 0.5 ) epochs = Epochs ( raw , events [ : 7 ] , event_id = event_id , tmin = tmin , tmax = tmax , picks = picks , baseline = ( None , 0 ) , preload = True ) data = epochs . get_data ( ) rt_client = MockRtClient ( raw ) rt_epochs = RtEpochs ( rt_client , event_id , tmin , tmax , picks = picks , isi_max = 0.5 ) rt_epochs . start ( ) rt_client . send_data ( rt_epochs , picks , tmin = 0 , tmax = 10 , buffer_size = 1000 ) rt_data = rt_epochs . get_data ( ) assert_true ( ( rt_data . shape == data . shape ) ) assert_array_equal ( rt_data , data )
test the rtmockclient .