code: def test_spatialite_error_if_attempt_to_open_spatialite(
      spatialite_paths, should_suggest_load_extension
  ):
      with mock.patch(
          "datasette.utils.SPATIALITE_PATHS", spatialite_paths
      ):
          runner = CliRunner()
          result = runner.invoke(
              cli,
              [
                  "serve",
                  str(pathlib.Path(__file__).parent / "spatialite.db"),
              ],
          )
          assert result.exit_code != 0
          assert (
              "It looks like you're trying to load a SpatiaLite"
              in result.output
          )
          suggestion = "--load-extension=spatialite"
          if should_suggest_load_extension:
              assert suggestion in result.output
          else:
              assert suggestion not in result.output
  
imports: from .fixtures import app_client, make_app_client, TestClient, EXPECTED_PLUGINS
  import asyncio
  from datasette.app import SETTINGS
  from datasette.plugins import DEFAULT_PLUGINS
  from datasette.cli import cli, serve
  from datasette.version import __version__
  from datasette.utils import tilde_encode
  from datasette.utils.sqlite import sqlite3
  from click.testing import CliRunner
  import io
  import json
  import pathlib
  import pytest
  import sys
  import textwrap
  from unittest import mock
  import urllib
label_desc: Use image node_id 4 for calling a global function with example usage: test_spatialite_error_if_attempt_to_open_spatialite(spatialite_paths, should_suggest_load_extension) without return types