test_age_envelope.py
python
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3
docs: docstring sprint contract→find-symbol — idiomatic run…
Sonnet 4.6
patch
142 days ago
| 1 | """Envelope tests for ``muse code age --json``.""" |
| 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 | def _age_json(*extra): |
| 10 | return runner.invoke(None, ["code", "age", "--json", *extra]) |
| 11 | |
| 12 | class TestAgeEnvelope: |
| 13 | def test_has_muse_version(self): |
| 14 | r = _age_json() |
| 15 | assert r.exit_code == 0, r.output |
| 16 | assert "muse_version" in json.loads(r.output) |
| 17 | |
| 18 | def test_has_schema(self): |
| 19 | r = _age_json() |
| 20 | assert "schema" in json.loads(r.output) |
| 21 | |
| 22 | def test_has_timestamp(self): |
| 23 | r = _age_json() |
| 24 | assert "timestamp" in json.loads(r.output) |
| 25 | |
| 26 | def test_has_warnings(self): |
| 27 | r = _age_json() |
| 28 | assert "warnings" in json.loads(r.output) |
| 29 | |
| 30 | def test_no_schema_version(self): |
| 31 | r = _age_json() |
| 32 | assert "schema_version" not in json.loads(r.output) |
| 33 | |
| 34 | def test_j_alias_works(self): |
| 35 | r = runner.invoke(None, ["code", "age", "-j"]) |
| 36 | assert r.exit_code == 0 |
| 37 | d = json.loads(r.output) |
| 38 | assert "muse_version" in d |
File History
1 commit
sha256:88ac91129873e6a496e9189515aa690eb893ae25d69c8f72af141a2be5068eb3
docs: docstring sprint contract→find-symbol — idiomatic run…
Sonnet 4.6
patch
142 days ago