code: def test_failing_import_dashboards_versioned_export(
      import_dashboards_command, app_context, fs, caplog
  ):
      """
      Test that failing to import either ZIP and JSON is done elegantly.
      """
      # pylint: disable=reimported, redefined-outer-name
      import superset.cli.importexport  # noqa: F811
  
      # reload to define export_dashboards correctly based on the
      # feature flags
      importlib.reload(superset.cli.importexport)
  
      # write JSON file
      with open("dashboards.json", "w") as fp:
          fp.write('{"hello": "world"}')
  
      runner = app.test_cli_runner()
      response = runner.invoke(
          superset.cli.importexport.import_dashboards,
          ("-p", "dashboards.json"),
      )
  
      assert_cli_fails_properly(response, caplog)
  
      # write ZIP file
      with ZipFile("dashboards.zip", "w") as bundle:
          with bundle.open("dashboards/dashboard.yaml", "w") as fp:
              fp.write(b"hello: world")
  
      runner = app.test_cli_runner()
      response = runner.invoke(
          superset.cli.importexport.import_dashboards,
          ("-p", "dashboards.zip"),
      )
  
      assert_cli_fails_properly(response, caplog)
  
imports: import importlib
  import json
  import logging
  from pathlib import Path
  from unittest import mock
  from zipfile import is_zipfile, ZipFile
  import pytest
  import yaml
  from freezegun import freeze_time
  import superset.cli.importexport
  import superset.cli.thumbnails
  from superset import app, db
  from superset.models.dashboard import Dashboard
  from tests.integration_tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices, load_birth_names_data
label_desc: Use image node_id 9 for calling a global function with example usage: test_failing_import_dashboards_versioned_export(import_dashboards_command, app_context, fs, caplog) without return types