def METHOD_NAME():
    assert ChunkUploader.chunk_path_to_middle_path_name(
        Path("/a/b/2022-04-19_09-27_0.00000000.pghoard"), FileType.Basebackup
    ) == (Path("basebackup"), "2022-04-19_09-27_0.00000000.pghoard")
    assert ChunkUploader.chunk_path_to_middle_path_name(
        Path("/a/b/2022-04-19_09-27_0/2022-04-19_09-27_0.00000001.pghoard"), FileType.Basebackup_chunk
    ) == (Path("basebackup_chunk"), "2022-04-19_09-27_0/2022-04-19_09-27_0.00000001.pghoard")
    assert ChunkUploader.chunk_path_to_middle_path_name(
        Path("/a/b/0fdc9365aea5447f9a16da8104dc9fcc.delta"), FileType.Basebackup_delta
    ) == (Path("basebackup_delta"), "0fdc9365aea5447f9a16da8104dc9fcc.delta")
    assert ChunkUploader.chunk_path_to_middle_path_name(
        Path("/a/b/2022-04-19_09-27_0/2022-04-19_09-27_0.00000001.pghoard"), FileType.Basebackup_delta_chunk
    ) == (Path("basebackup_delta_chunk"), "2022-04-19_09-27_0/2022-04-19_09-27_0.00000001.pghoard")
    for file_type in {FileType.Wal, FileType.Metadata, FileType.Timeline}:
        with pytest.raises(NotImplementedError):
            ChunkUploader.chunk_path_to_middle_path_name(Path("/a/b/000000010000000000000002"), file_type)