#NEWLINE# @ with_setup ( setup_tmpdata , teardown_tmpdata ) #NEWLINE# def test_fetch_one_column( ) : #NEWLINE# #INDENT# _urlopen_ref = datasets . mldata . urlopen #NEWLINE# try : #NEWLINE# #INDENT# dataname = 'onecol' #NEWLINE# x = sp . arange ( 6 ) . reshape ( 2 , 3 ) #NEWLINE# datasets . mldata . urlopen = mock_mldata_urlopen ( { #NEWLINE# #INDENT# dataname : { #NEWLINE# #INDENT# 'x' : x , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# dset = fetch_mldata ( dataname , data_home = tmpdir ) #NEWLINE# for n in [ 'COL_NAMES' , 'DESCR' , 'data' ] : #NEWLINE# #INDENT# assert_in ( n , dset ) #NEWLINE# #UNINDENT# assert_not_in ( 'target' , dset ) #NEWLINE# assert_equal ( dset . data . shape , ( 2 , 3 ) ) #NEWLINE# assert_array_equal ( dset . data , x ) #NEWLINE# dset = fetch_mldata ( dataname , transpose_data = False , data_home = tmpdir ) #NEWLINE# assert_equal ( dset . data . shape , ( 3 , 2 ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# datasets . mldata . urlopen = _urlopen_ref