code: def test_version_arg_app(tmpdir):
      # Version does not exist
      app_name = "lightning/invideo"
      version_arg = "NOT-EXIST"
      runner = CliRunner()
      result = runner.invoke(
          lightning_cli.cmd_install.install_app,
          [app_name, f"--version={version_arg}"],
      )
      assert (
          f"app: 'Version {version_arg} for {app_name}' is not"
          in str(result.exception)
      )
      assert result.exit_code == 1
  
      # Version exists
      version_arg = "0.0.2"
      runner = CliRunner()
      result = runner.invoke(
          lightning_cli.cmd_install.install_app,
          [app_name, f"--version={version_arg}", "--yes"],
      )
      assert result.exit_code == 0
  
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 9 for calling a global function with example usage: test_version_arg_app(tmpdir) without return types