"""Envelope tests for branch command.""" from __future__ import annotations import json import pytest from tests.cli_test_helper import CliRunner runner = CliRunner() _FIELDS = ("muse_version", "schema", "timestamp", "warnings") def _check(d: dict) -> None: for f in _FIELDS: assert f in d, f"missing {f}" assert "schema_version" not in d class TestBranchEnvelope: def test_list_has_envelope(self): r = runner.invoke(None, ["branch", "--json"]) assert r.exit_code == 0, r.output d = json.loads(r.output) _check(d) assert "branches" in d