code: def test_component_install(real_component, test_component_pip_name):
      """Tests both published and unpublished component installs."""
      # uninstall component just in case and verify it's not in the pip output
      env_output = subprocess.check_output(
          f"pip uninstall {test_component_pip_name} --yes && pip freeze",
          shell=True,
      )
      assert test_component_pip_name not in str(
          env_output
      ), f"{test_component_pip_name} should not be in the env"
  
      # install component and verify it's in the env
      new_env_output = subprocess.check_output(
          f"lightning install component {real_component} --yes && pip freeze",
          shell=True,
      )
      assert test_component_pip_name in str(
          new_env_output
      ), f"{test_component_pip_name} should be in the env"
  
      # clean up for test
      subprocess.run(
          f"pip uninstall {test_component_pip_name} --yes", shell=True
      )
      env_output = subprocess.check_output("pip freeze", shell=True)
      assert test_component_pip_name not in str(
          env_output
      ), f"{test_component_pip_name} should not be in the env after cleanup"
  
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 6 for calling a global function with example usage: test_component_install(real_component, test_component_pip_name) without return types