def test_io_dig_points():
 tempdir = _TempDir()
 points = _read_dig_points(hsp_fname)
 dest = op.join(tempdir, 'test.txt')
 dest_bad = op.join(tempdir, 'test.mne')
 assert_raises(ValueError, _write_dig_points, dest, points[:, :2])
 assert_raises(ValueError, _write_dig_points, dest_bad, points)
 _write_dig_points(dest, points)
 points1 = _read_dig_points(dest, unit='m')
 err = 'Dig points diverged after writing and reading.'
 assert_array_equal(points, points1, err)
 points2 = np.array([[(-106.93), 99.8], [99.8, 68.81]])
 np.savetxt(dest, points2, delimiter=' DCTB ', newline='\n')
 assert_raises(ValueError, _read_dig_points, dest)

def test_io_dig_points ( ) : tempdir = _TempDir ( ) points = _read_dig_points ( hsp_fname ) dest = op . join ( tempdir , 'test.txt' ) dest_bad = op . join ( tempdir , 'test.mne' ) assert_raises ( ValueError , _write_dig_points , dest , points [ : , : 2 ] ) assert_raises ( ValueError , _write_dig_points , dest_bad , points ) _write_dig_points ( dest , points ) points1 = _read_dig_points ( dest , unit = 'm' ) err = 'Dig points diverged after writing and reading.' assert_array_equal ( points , points1 , err ) points2 = np . array ( [ [ ( - 106.93 ) , 99.8 ] , [ 99.8 , 68.81 ] ] ) np . savetxt ( dest , points2 , delimiter = ' DCTB ' , newline = '\n' ) assert_raises ( ValueError , _read_dig_points , dest )
test writing for dig files .