gabriel / muse public
test_cat_object_envelope.py python
28 lines 885 B
Raw
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3 docs: docstring sprint contract→find-symbol — idiomatic run… Sonnet 4.6 patch 139 days ago
1 """Envelope tests for cat-object command."""
2 from __future__ import annotations
3 import json
4 import pytest
5 from tests.cli_test_helper import CliRunner
6
7 runner = CliRunner()
8
9 _FIELDS = ("muse_version", "schema", "timestamp", "warnings")
10
11
12 def _check(d: dict) -> None:
13 for f in _FIELDS:
14 assert f in d, f"missing {f}"
15 assert "schema_version" not in d
16
17
18 class TestCatObjectEnvelope:
19 def test_cat_object_info_has_envelope(self):
20 # Get a real object ID from the repo
21 r = runner.invoke(None, ["ls-files", "--json"])
22 assert r.exit_code == 0, r.output
23 files = json.loads(r.output)["files"]
24 assert files, "need at least one tracked file"
25 obj_id = files[0]["object_id"]
26 r2 = runner.invoke(None, ["cat-object", obj_id, "--format", "info"])
27 assert r2.exit_code == 0, r2.output
28 _check(json.loads(r2.output))
File History 1 commit
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3 docs: docstring sprint contract→find-symbol — idiomatic run… Sonnet 4.6 patch 139 days ago