code: def test_extract_region(monkeypatch):
      if os.environ.get("REGION"):
          monkeypatch.delenv("REGION")
  
      assert c.extract_region({}) == c.DEFAULT_REGION
  
      # You have to provide a valid region.
      with pytest.raises(ArgumentTypeError):
          c.extract_region({"region": "face"})
  
      # Same goes for the environment variable setting approach.
      monkeypatch.setenv("REGION", "face")
      with pytest.raises(ArgumentTypeError):
          c.extract_region({})
  
      # an empty string is fine, and ignored.
      monkeypatch.setenv("REGION", "")
      assert c.extract_region({}) == c.DEFAULT_REGION
  
      assert c.extract_region({"region": "us-west1"}) == ct.US.west1
  
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 6 for calling a global function with example usage: test_extract_region(monkeypatch) without return types