code: def test_pl_app_input_paths_do_not_exist(tmp_path):
      """Test that the CLI prints an error message if the code directory or the script path does not exist."""
      runner = CliRunner()
  
      source_dir = tmp_path / "code"
      script_file = tmp_path / "code" / "script.py"
  
      result = runner.invoke(
          lightning_cli.init_pl_app, (str(source_dir), str(script_file))
      )
      assert result.exit_code == 1
      assert (
          "The given source directory does not exist:" in result.output
      )
  
      source_dir.mkdir(parents=True)
  
      result = runner.invoke(
          lightning_cli.init_pl_app, (str(source_dir), str(script_file))
      )
      assert result.exit_code == 1
      assert "The given script path does not exist:" in result.output
  
      script_file_as_folder = tmp_path / "code" / "folder"
      script_file_as_folder.mkdir(parents=True)
      result = runner.invoke(
          lightning_cli.init_pl_app,
          (str(source_dir), str(script_file_as_folder)),
      )
      assert result.exit_code == 1
      assert (
          "The given script path must be a file, you passed:"
          in result.output
      )
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cmd_pl_init.py
imports: import os
  import sys
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from click.testing import CliRunner
  from lightning.app.cli import lightning_cli
  from lightning.app.cli.cmd_pl_init import _can_encode_icon, download_frontend, pl_app
label_desc: Use image node_id 1 for calling a global function with example usage: test_pl_app_input_paths_do_not_exist(tmp_path) without return types