code: def test_metadata_yaml():
      yaml_file = io.StringIO(
          textwrap.dedent(
              """
      title: Hello from YAML
      """
          )
      )
      # Annoyingly we have to provide all default arguments here:
      ds = serve.callback(
          [],
          metadata=yaml_file,
          immutable=[],
          host="127.0.0.1",
          port=8001,
          uds=None,
          reload=False,
          cors=False,
          sqlite_extensions=[],
          inspect_file=None,
          template_dir=None,
          plugins_dir=None,
          static=[],
          memory=False,
          config=[],
          settings=[],
          secret=None,
          root=False,
          token=None,
          actor=None,
          version_note=None,
          get=None,
          help_settings=False,
          pdb=False,
          crossdb=False,
          nolock=False,
          open_browser=False,
          create=False,
          ssl_keyfile=None,
          ssl_certfile=None,
          return_instance=True,
          internal=None,
      )
      client = _TestClient(ds)
      response = client.get("/-/metadata.json")
      assert {"title": "Hello from YAML"} == response.json
  
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 7 for calling a global function with example usage: test_metadata_yaml() without return types