def METHOD_NAME(mock_unlink, mock_tempfile, mock_run, tmp_path):
    mock_tempfile.return_value.__enter__.return_value.name = "/tmp/foobar"
    apt_sources_manager._sudo_write_file(dst_path="/foo/bar", content=b"some-content")
    assert mock_tempfile.mock_calls == [
        call(delete=False),
        call().__enter__(),
        call().__enter__().write(b"some-content"),
        call().__enter__().flush(),
        call().__exit__(None, None, None),
    ]
    assert mock_run.mock_calls == [
        call(
            [
                "sudo",
                "install",
                "--owner=root",
                "--group=root",
                "--mode=0644",
                "/tmp/foobar",
                "/foo/bar",
            ],
            check=True,
        )
    ]
    assert mock_unlink.mock_calls == [call("/tmp/foobar")]