code: def test_building_choropleth_map_w_custom_geojson(unittest):
      import dtale.views as views
  
      df = pd.DataFrame(
          [
              dict(id="US.MA", name="mass", pop=125),
              dict(id="US.WA", name="wash", pop=500),
              dict(id="US.CA", name="cali", pop=1000),
          ]
      )
  
      with app.test_client() as c:
          with ExitStack() as stack:
              custom_geojson_data = []
              stack.enter_context(
                  mock.patch(
                      "dtale.dash_application.custom_geojson.CUSTOM_GEOJSON",
                      custom_geojson_data,
                  )
              )
              params = {
                  "output": "..output-geojson-upload.children...geojson-dropdown.options..",
                  "changedPropIds": ["upload-geojson.content"],
                  "inputs": [
                      {
                          "id": "upload-geojson",
                          "property": "content",
                          "value": build_geojson_data(),
                      }
                  ],
                  "state": [
                      {
                          "id": "upload-geojson",
                          "property": "filename",
                          "value": "USA.json",
                      }
                  ],
              }
              c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
  
              df, _ = views.format_data(df)
              build_data_inst({c.port: df})
              inputs = {"chart_type": "maps", "agg": "raw"}
              map_inputs = {
                  "map_type": "choropleth",
                  "loc_mode": "geojson-id",
                  "geojson": "USA",
                  "featureidkey": "HASC_1",
                  "loc": "id",
                  "map_val": "pop",
              }
              chart_inputs = {"colorscale": "Reds"}
              params = build_chart_params(
                  c.port, inputs, chart_inputs, map_inputs=map_inputs
              )
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              chart_markup = response.get_json()["response"][
                  "chart-content"
              ]["children"]["props"]["children"][1]
              unittest.assertEqual(
                  chart_markup["props"]["figure"]["layout"]["title"],
                  {"text": "Map of pop (No Aggregation)"},
              )
  
file_path: dtale/tests/dtale/dash/test_custom_geojson.py
imports: import base64
  import json
  import mock
  import os
  import pandas
  import pytest
  from tests import ExitStack
  from tests.dtale import build_data_inst
  from tests.dtale.dash.test_dash import build_chart_params
  from tests.dtale.test_views import app
label_desc: Use image node_id 5 for calling a global function with example usage: test_building_choropleth_map_w_custom_geojson(unittest) without return types