

def test_convert(self):
    tempdir = self.tempdir
    with remember_cwd():
        os.chdir(tempdir)
        assert_raises(IOError, adult.convert_adult, directory=tempdir, output_directory=tempdir)
        default_downloader(directory=tempdir, urls=['https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data', 'https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.test'], filenames=['adult.data', 'adult.test'])
        adult.convert_adult(directory=tempdir, output_directory=tempdir)
    output_file = 'adult.hdf5'
    output_file = os.path.join(tempdir, output_file)
    with h5py.File(output_file, 'r') as h5:
        assert (h5['features'].shape == ((30162 + 15060), 104))
        assert (h5['targets'].shape[0] == h5['features'].shape[0])

dataset/ETHPy150Open mila-udem/fuel/tests/test_converters.py TestAdult.test_convert/original