code: def test_install_resolve_latest_version(
      mock_show_install_app_prompt, tmpdir
  ):
      app_name = "lightning/invideo"
      runner = CliRunner()
      with mock.patch(
          "lightning.app.cli.cmd_install.requests.get"
      ) as get_api_mock:
          get_api_mock.return_value.json.return_value = {
              "apps": [
                  {
                      "canDownloadSourceCode": True,
                      "version": "0.0.2",
                      "name": "lightning/invideo",
                  },
                  {
                      "canDownloadSourceCode": True,
                      "version": "0.0.4",
                      "name": "lightning/invideo",
                  },
                  {
                      "canDownloadSourceCode": True,
                      "version": "0.0.5",
                      "name": "another_app",
                  },
              ]
          }
          runner.invoke(
              lightning_cli.cmd_install.install_app, [app_name, "--yes"]
          )  # no version specified so latest is installed
          assert mock_show_install_app_prompt.called
          assert (
              mock_show_install_app_prompt.call_args[0][0]["version"]
              == "0.0.4"
          )
  
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 10 for calling a global function with example usage: test_install_resolve_latest_version(mock_show_install_app_prompt, tmpdir) without return types