code: def test_pl_app_script_path_not_subpath(tmp_path):
      """Test that the CLI prints an error message if the provided script path is not a subpath of the source dir."""
      runner = CliRunner()
  
      source_dir = tmp_path / "code"
      script_file = tmp_path / "not_code" / "script.py"
  
      source_dir.mkdir(parents=True)
      script_file.parent.mkdir(parents=True)
      script_file.touch()
  
      result = runner.invoke(
          lightning_cli.init_pl_app,
          (str(source_dir), str(script_file)),
          catch_exceptions=False,
      )
      assert result.exit_code == 1
      assert (
          "The given script path must be a subpath of the source directory."
          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 2 for calling a global function with example usage: test_pl_app_script_path_not_subpath(tmp_path) without return types