code: def assert_permissions_checked(datasette, actions):
      # actions is a list of "action" or (action, resource) tuples
      for action in actions:
          if isinstance(action, str):
              resource = None
          else:
              action, resource = action
          assert [
              pc
              for pc in datasette._permission_checks
              if pc["action"] == action and pc["resource"] == resource
          ], """Missing expected permission check: action={}, resource={}
          Permission checks seen: {}
          """.format(
              action,
              resource,
              json.dumps(list(datasette._permission_checks), indent=4),
          )
  
imports: from datasette.app import Datasette
  from datasette.utils.sqlite import sqlite3
  from datasette.utils.testing import TestClient
  import click
  import contextlib
  import itertools
  import json
  import os
  import pathlib
  import pytest
  import random
  import string
  import tempfile
  import textwrap
label_desc: Use image node_id 19 for calling a global function with example usage: assert_permissions_checked(datasette, actions) without return types