

@mock.patch('fuel.converters.celeba.NUM_EXAMPLES', 10)
def test_aligned_cropped_converter(self):
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()
    subparser = subparsers.add_parser('celeba')
    convert_function = celeba.fill_subparser(subparser)
    subparser.set_defaults(directory=self.tempdir, output_directory=self.tempdir, output_filename='celeba_aligned_cropped.hdf5')
    args = parser.parse_args(['celeba', 'aligned_cropped'])
    args_dict = vars(args)
    (filename,) = convert_function(**args_dict)
    h5file = h5py.File(filename, mode='r')
    assert_equal(h5file['features'].shape, (10, 3, 218, 178))
    assert_equal(h5file['targets'].shape, (10, 40))

dataset/ETHPy150Open mila-udem/fuel/tests/test_converters.py TestCelebA.test_aligned_cropped_converter/original