code: def test_update_geojson():
      with app.test_client() as c:
          with ExitStack() as stack:
              custom_geojson_data = []
              build_data_inst({c.port: None})
              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",
                      }
                  ],
              }
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              resp_data = response.get_json()["response"]
              assert (
                  resp_data["output-geojson-upload"]["children"]
                  == "USA uploaded!"
              )
              assert resp_data["geojson-dropdown"]["options"] == [
                  {"label": "USA", "value": "USA"}
              ]
              assert len(custom_geojson_data) == 1
              assert custom_geojson_data[0]["key"] == "USA"
  
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              resp_data = response.get_json()["response"]
              assert (
                  resp_data["output-geojson-upload"]["children"]
                  == "USA2 uploaded!"
              )
              assert resp_data["geojson-dropdown"]["options"][-1] == {
                  "label": "USA2",
                  "value": "USA2",
              }
              assert len(custom_geojson_data) == 2
              assert custom_geojson_data[-1]["key"] == "USA2"
  
              africa_fname = "/../../../".join(
                  [
                      os.path.dirname(__file__),
                      "dtale/static/maps/africa_110m.json",
                  ]
              )
              africa_data = build_geojson_data(fname=africa_fname)
              params["inputs"][0]["value"] = africa_data
              params["state"][0]["value"] = "africa_110m.json"
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              resp_data = response.get_json()["response"]
              assert (
                  resp_data["output-geojson-upload"]["children"]
                  == "africa_110m uploaded!"
              )
              assert resp_data["geojson-dropdown"]["options"][-1] == {
                  "label": "africa_110m",
                  "value": "africa_110m",
              }
              assert len(custom_geojson_data) == 3
              assert custom_geojson_data[-1]["key"] == "africa_110m"
              assert custom_geojson_data[-1].get("properties") is None
  
              params["state"][0]["value"] = None
              response = c.post(
                  "/dtale/charts/_dash_update-component", json=params
              )
              assert response.status_code == 405
  
              params["state"][0]["value"] = "USA.json"
              params["inputs"][0]["value"] = None
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              resp_data = response.get_json()["response"]
              assert (
                  resp_data["output-geojson-upload"]["children"]
                  == "'NoneType' object has no attribute 'split'"
              )
  
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 2 for calling a global function with example usage: test_update_geojson() without return types