def test_finitedataset_source_check():
 dataset = DenseDesignMatrix(X=np.random.rand(20, 15).astype(theano.config.floatX), y=np.random.rand(20, 5).astype(theano.config.floatX))
 assert_raises(ValueError, dataset.iterator, mode='sequential', batch_size=5, data_specs=(VectorSpace(15), 'featuresX'))
 try:
  dataset.iterator(mode='sequential', batch_size=5, data_specs=(VectorSpace(15), 'featuresX'))
 except ValueError as e:
  assert ('featuresX' in str(e))

def test_finitedataset_source_check ( ) : dataset = DenseDesignMatrix ( X = np . random . rand ( 20 , 15 ) . astype ( theano . config . floatX ) , y = np . random . rand ( 20 , 5 ) . astype ( theano . config . floatX ) ) assert_raises ( ValueError , dataset . iterator , mode = 'sequential' , batch_size = 5 , data_specs = ( VectorSpace ( 15 ) , 'featuresX' ) ) try : dataset . iterator ( mode = 'sequential' , batch_size = 5 , data_specs = ( VectorSpace ( 15 ) , 'featuresX' ) ) except ValueError as e : assert ( 'featuresX' in str ( e ) )
check that the finitedatasetiterator returns sensible errors when there is a missing source in the dataset .