code: def test_rename_fields_check_log(caplog: LogCaptureFixture):
      d = {"api_server.port": 5000}
      with caplog.at_level(logging.WARNING):
          rename_fields(d, "api_server.port", "api_server.http.port")
      assert (
          "Field 'api_server.port' is deprecated and has been renamed to 'api_server.http.port'"
          in caplog.text
      )
      assert (
          "api_server.http.port" in d
          and d["api_server.http.port"] == 5000
      )
  
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING
  import pytest
  from bentoml._internal.configuration.helpers import expand_env_var_in_values
  from bentoml._internal.configuration.helpers import flatten_dict
  from bentoml._internal.configuration.helpers import is_valid_ip_address
  from bentoml._internal.configuration.helpers import load_config_file
  from bentoml._internal.configuration.helpers import rename_fields
  from bentoml.exceptions import BentoMLConfigException
label_desc: Use image node_id 5 for calling a global function with example usage: test_rename_fields_check_log(caplog) without return types