def METHOD_NAME(
    self, new_dir, icon, icon_path, expected_icon
):
    snap_name = app_name = "foo"
    desktop_file_path = new_dir / "app.desktop"
    with desktop_file_path.open("w") as desktop_file:
        print("[Desktop Entry]", file=desktop_file)
        print("Exec=in-snap-exe", file=desktop_file)
        print(f"Icon={icon}", file=desktop_file)
        print("[Desktop Entry Two]", file=desktop_file)
        print("Exec=in-snap-exe2", file=desktop_file)
        print(f"Icon={icon}", file=desktop_file)
    if icon_path is not None:
        (new_dir / icon_path).touch()
    d = DesktopFile(
        snap_name=snap_name,
        app_name=app_name,
        filename=desktop_file_path,
        prime_dir=new_dir,
    )
    if icon_path is not None:
        d.write(icon_path=icon_path, gui_dir=Path())
    else:
        d.write(gui_dir=Path())
    expected_desktop_file = new_dir / f"{app_name}.desktop"
    assert expected_desktop_file.exists()
    with expected_desktop_file.open() as desktop_file:
        assert desktop_file.read() == dedent(
            f"""\
            [Desktop Entry]
            Exec=foo
            Icon={expected_icon}
            [Desktop Entry Two]
            Exec=foo
            Icon={expected_icon}
            """
        )