def METHOD_NAME(self,
                  shape,
                  tile_shape,
                  link_input: bool,
                  expected_num_levels,
                  expected_shapes,
                  expected_chunks):
    input_path = get_path("pyramid-input.zarr")
    output_path = get_path("pyramid-output")
    rimraf(input_path)
    rimraf(output_path)
    try:
        dataset = self.create_test_dataset(shape,
                                           chunks=(1, *tile_shape))
        dataset.to_zarr(input_path)
        t0 = time.perf_counter()
        levels = write_levels(output_path,
                              dataset=dataset,
                              spatial_tile_shape=tile_shape,
                              input_path=input_path,
                              link_input=link_input)
        print(f"write time total: ", time.perf_counter() - t0)
        self._assert_levels_ok(levels,
                               expected_num_levels,
                               expected_shapes,
                               expected_chunks)
        t0 = time.perf_counter()
        levels = read_levels(output_path)
        print(f"read time total: ", time.perf_counter() - t0)
        self._assert_levels_ok(levels,
                               expected_num_levels,
                               expected_shapes,
                               expected_chunks)
    finally:
        rimraf(input_path)
        rimraf(output_path)