code: def test_build_config_dockerfile_warns(monkeypatch, caplog):
      dockerfile = "foo"
      bc = BuildConfig(dockerfile=dockerfile)
      monkeypatch.setattr(
          bc, "_find_dockerfile", lambda *_, **__: "bar"
      )
      work = Mock()
      with caplog.at_level(logging.INFO):
          bc.on_work_init(work)
      assert "exists at 'bar' but 'foo' was passed" in caplog.text
      assert bc.dockerfile == dockerfile
  
imports: import logging
  import os
  import sys
  from unittest.mock import Mock
  from lightning.app.testing import LightningTestApp, application_testing
  from lightning.app.utilities.packaging.build_config import BuildConfig
  from tests_app import _TESTS_ROOT
label_desc: Use image node_id 8 for calling a global function with example usage: test_build_config_dockerfile_warns(monkeypatch, caplog) without return types