code: def test_validate_configuration(
      container_from_file: t.Callable[[str], ConfigDictType]
  ):
      CONFIG = """\
  version: 1
  api_server:
    http:
      host: 0.0.0.0
  """
      config = container_from_file(CONFIG)
      assert config["api_server"]["http"]["host"] == "0.0.0.0"
  
      INVALID_CONFIG = """\
  version: 1
  api_server:
    cors:
      max_age: 12345
  """
      with pytest.raises(
          BentoMLConfigException,
          match="Invalid configuration file was given:*",
      ):
          container_from_file(INVALID_CONFIG)
  
file_path: BentoML/tests/unit/_internal/configuration/test_containers.py
imports: from __future__ import annotations
  import typing
  from typing import TYPE_CHECKING
  import pytest
  from bentoml.exceptions import BentoMLConfigException
label_desc: Use image node_id 1 for calling a global function with example usage: test_validate_configuration(container_from_file) without return types