def test_read_write_info():
 tempdir = _TempDir()
 info = read_info(raw_fname)
 temp_file = op.join(tempdir, 'info.fif')
 info['dev_head_t']['trans'] = np.eye(4)
 t1 = info['dev_head_t']['trans']
 write_info(temp_file, info)
 info2 = read_info(temp_file)
 t2 = info2['dev_head_t']['trans']
 assert_true((len(info['chs']) == len(info2['chs'])))
 assert_array_equal(t1, t2)
 creator = u'\xe9'
 info = read_info(chpi_fname)
 info['proc_history'][0]['creator'] = creator
 info['hpi_meas'][0]['creator'] = creator
 info['subject_info']['his_id'] = creator
 write_info(temp_file, info)
 info = read_info(temp_file)
 assert_equal(info['proc_history'][0]['creator'], creator)
 assert_equal(info['hpi_meas'][0]['creator'], creator)
 assert_equal(info['subject_info']['his_id'], creator)

def test_read_write_info ( ) : tempdir = _TempDir ( ) info = read_info ( raw_fname ) temp_file = op . join ( tempdir , 'info.fif' ) info [ 'dev_head_t' ] [ 'trans' ] = np . eye ( 4 ) t1 = info [ 'dev_head_t' ] [ 'trans' ] write_info ( temp_file , info ) info2 = read_info ( temp_file ) t2 = info2 [ 'dev_head_t' ] [ 'trans' ] assert_true ( ( len ( info [ 'chs' ] ) == len ( info2 [ 'chs' ] ) ) ) assert_array_equal ( t1 , t2 ) creator = u'\xe9' info = read_info ( chpi_fname ) info [ 'proc_history' ] [ 0 ] [ 'creator' ] = creator info [ 'hpi_meas' ] [ 0 ] [ 'creator' ] = creator info [ 'subject_info' ] [ 'his_id' ] = creator write_info ( temp_file , info ) info = read_info ( temp_file ) assert_equal ( info [ 'proc_history' ] [ 0 ] [ 'creator' ] , creator ) assert_equal ( info [ 'hpi_meas' ] [ 0 ] [ 'creator' ] , creator ) assert_equal ( info [ 'subject_info' ] [ 'his_id' ] , creator )
test io of info .