code: def test_r_loader_integration(unittest):
      pytest.importorskip("rpy2")
  
      path = os.path.join(
          os.path.dirname(__file__), "..", "data", "admissions.rda"
      )
  
      with ExitStack() as stack:
          mock_show = stack.enter_context(
              mock.patch("dtale.cli.script.show", mock.Mock())
          )
          args = ["--port", "9999", "--r-path", path]
          script.main(args, standalone_mode=False)
          mock_show.assert_called_once()
          _, kwargs = mock_show.call_args
          assert kwargs["data_loader"] is not None
          df = kwargs["data_loader"]()
          unittest.assertEqual(
              list(df.columns),
              ["major", "gender", "admitted", "applicants"],
          )
          assert len(df) == 12
          unittest.assertEqual(
              df.to_dict(orient="records")[0],
              dict(
                  major="A", gender="men", admitted=62, applicants=825
              ),
          )
  
imports: import os
  import sys
  from imp import reload
  import mock
  import pandas
  import pytest
  from six import PY3
  from dtale.cli import loaders, script
  from dtale.cli.clickutils import run
  from dtale.pandas_util import check_pandas_version
  from tests import ExitStack, pdt
label_desc: Use image node_id 12 for calling a global function with example usage: test_r_loader_integration(unittest) without return types