code: def test_extract_project_id(monkeypatch):
      if os.environ.get("PROJECT_ID"):
          monkeypatch.delenv("PROJECT_ID")
  
      # if NO project ID is specified on the environment OR in the supplied config,
      # the system attempts to exit.
      with pytest.raises(SystemExit) as wrapped_e:
          c.extract_project_id({})
  
      assert wrapped_e.type == SystemExit
      assert wrapped_e.value.code == 1
  
      # the project ID gets mirrored back if it exists in the config.
      assert c.extract_project_id({"project_id": "face"}) == "face"
  
      monkeypatch.setenv("PROJECT_ID", "env_id")
  
      # If the env variable is set it's returned:
      assert c.extract_project_id({"project_id": None}) == "env_id"
  
      # Unless the project ID's set in the config.
      assert c.extract_project_id({"project_id": "face"}) == "face"
  
file_path: caliban/tests/caliban/config/test_config.py
imports: import json
  import os
  from argparse import ArgumentTypeError
  import hypothesis.strategies
  from hypothesis import given
  import caliban.config
  import caliban.platform.cloud.types
  import caliban.util.schema
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_extract_project_id(monkeypatch) without return types