code: def assert_cli_fails_properly(response, caplog):
      """
      Ensure that a CLI command fails according to a predefined behaviour.
      """
      # don't exit successfully
      assert response.exit_code != 0
  
      # end the logs with a record on an error
      assert caplog.records[-1].levelname == "ERROR"
  
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 1 for calling a global function with example usage: assert_cli_fails_properly(response, caplog) without return types