def METHOD_NAME(self):
    generator = MPIIOMockGenerator(self.temp_dir.name)
    mpiio = espressomd.io.mpiio.Mpiio()
    # generate reference data
    self.system.part.add(pos=[0, 0, 0])
    path_ref = generator.create()[0]
    mpiio.write(path_ref, types=True)
    self.system.part.clear()
    # check reference data is valid
    mpiio.read(path_ref, types=True)
    self.system.part.clear()
    # exception when the metadata cannot be written
    path, fn = generator.create('head', read_only=True)
    with self.assertRaisesRegex(RuntimeError, f'Could not open file "{fn}"'):
        mpiio.write(path, types=True)
    # exception when the payload cannot be written
    path, fn = generator.create('pref', read_only=True)
    with self.assertRaisesRegex(RuntimeError, f'Could not open file "{fn}"'):
        mpiio.write(path, types=True)
    # exception when calculating the size of a non-existent file
    path, _ = generator.create(read_only=True)
    fn = f'{path}.pref'
    with self.assertRaisesRegex(RuntimeError, f'Could not get file size of "{fn}"'):
        mpiio.read(path, types=True)
    # exception when the MPI world size differs for reading and writing
    # (empty .pref file -> data was written with MPI world size of 0)
    path, _ = generator.create('id', 'pref', read_only=True)
    with self.assertRaisesRegex(RuntimeError, f'Trying to read a file with a different COMM size than at point of writing'):
        mpiio.read(path, types=True)
    # exception when the particle types don't exist
    path, _ = generator.create(
        'pref', 'id', 'head', read_only=False, from_ref=path_ref)
    fn = f'{path}.type'
    with self.assertRaisesRegex(RuntimeError, f'Could not open file "{fn}"'):
        mpiio.read(path, types=True)
    # exception when the metadata doesn't exist
    path, _ = generator.create(
        'id', 'pref', read_only=False, from_ref=path_ref)
    fn = f'{path}.head'
    with self.assertRaisesRegex(RuntimeError, f'Could not open file "{fn}"'):
        mpiio.read(path, types=True)
    # exception when the metadata is empty
    with open(fn, 'wb'):
        pass
    with self.assertRaisesRegex(RuntimeError, f'Could not read file "{fn}"'):
        mpiio.read(path, types=True)
    # exception when reading data that was not written to disk
    # (empty .pref file -> data was written with MPI world size of 0)
    path, _ = generator.create(
        'id', 'pref', 'head', read_only=False, from_ref=path_ref)
    with self.assertRaisesRegex(RuntimeError, f'Requesting to read fields which were not dumped'):
        mpiio.read(path, types=True, bonds=True)