"""Envelope tests for ``muse code api-surface --json``.""" from __future__ import annotations import json from tests.cli_test_helper import CliRunner runner = CliRunner() class TestApiSurfaceEnvelope: def test_has_envelope_fields(self) -> None: r = runner.invoke(None, ["code", "api-surface", "--json"]) assert r.exit_code == 0, r.output d = json.loads(r.output) for f in ("muse_version", "schema", "timestamp", "warnings"): assert f in d, f"missing {f}" assert "schema_version" not in d