code: def test_valid_unpublished_app_name():
      runner = CliRunner()
  
      # assert warning of non official app given
      real_app = "https://github.com/Lightning-AI/install-app"
      with pytest.raises(
          subprocess.CalledProcessError, match="WARNING"
      ):
          subprocess.check_output(
              f"lightning install app {real_app}",
              shell=True,
              stderr=subprocess.STDOUT,
          )
  
      # assert aborted install
      result = runner.invoke(
          lightning_cli.cmd_install.install_app, [real_app], input="q"
      )
      assert "Installation aborted!" in result.output
  
      # assert a bad app name should fail
      fake_app = "https://github.com/Lightning-AI/install-appdd"
      result = runner.invoke(
          lightning_cli.cmd_install.install_app, [fake_app, "--yes"]
      )
      assert "Looks like the github url was not found" in result.output
  
      # assert a good (and availablea name) works
      result = runner.invoke(
          lightning_cli.cmd_install.install_app, [real_app]
      )
      assert "Press enter to continue:" in result.output
  
imports: import os
  import subprocess
  from pathlib import Path
  from unittest import mock
  import pytest
  from click.testing import CliRunner
  from lightning.app.cli import cmd_install, lightning_cli
  from lightning.app.testing.helpers import _RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_valid_unpublished_app_name() without return types