code: def test_collect_and_register_resources(mocker):
      app = dash.Dash(
          __name__,
          assets_folder="tests/assets",
          assets_ignore="load_after.+.js",
      )
      with mock.patch("dash.dash.os.stat", return_value=StatMock()):
          with mock.patch(
              "dash.dash.importlib.import_module"
          ) as import_mock:
              with mock.patch(
                  "sys.modules", {"dash_html_components": dcc}
              ):
                  import_mock.return_value = dcc
                  app._collect_and_register_resources(
                      [
                          {
                              "namespace": "dash_html_components",
                              "relative_package_path": "dash_html_components.min.js",
                          },
                      ]
                  )
                  import_mock.assert_any_call("dash_html_components")
  
file_path: dash/tests/unit/test_resources.py
imports: import mock
  import dash
  from dash import dcc, html
  from dash.development.base_component import ComponentRegistry
label_desc: Use image node_id 4 for calling a global function with example usage: test_collect_and_register_resources(mocker) without return types