Skip to content

Commit 7fade2b

Browse files
authored
fix(python): update the bare-verify tests for the default gate set (#499)
#475 made a bare verify run the template gate as well as the codegen gate. Two tests still described the old behaviour: one asserted a single stderr line, the other ran a config project with no prompt templates. They now match docs/features/cli.md and the Unreleased CHANGELOG entry; the code was right.
1 parent 4565725 commit 7fade2b

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎server/python/tests/codegen/test_cli_config_verify.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
from __future__ import annotations
33

44
import json
5+
import shutil
56
from pathlib import Path
67

78
from metaobjects.cli import main
89
from tests.codegen.gen_suite import GEN_SUITE
910
from tests.codegen.config_helpers import as_config
1011

11-
FITNESS = (
12-
Path(__file__).parents[4]
13-
/ "fixtures"
14-
/ "persistence-conformance"
15-
/ "canonical"
16-
/ "meta.fitness.json"
17-
)
12+
CANONICAL = Path(__file__).parents[4] / "fixtures" / "persistence-conformance" / "canonical"
13+
FITNESS = CANONICAL / "meta.fitness.json"
1814

1915
TWO_TARGETS = """
2016
targets:
@@ -59,6 +55,9 @@ def test_verify_codegen_no_args_in_sync(tmp_path: Path) -> None:
5955

6056
def test_verify_codegen_bare_defaults_to_codegen(tmp_path: Path, monkeypatch) -> None:
6157
_project(tmp_path)
58+
# Bare verify also runs the template gate against `prompts/` (the default root), and the
59+
# fitness model's `template.prompt` refs resolve there.
60+
shutil.copytree(CANONICAL / "prompts", tmp_path / "prompts")
6261
monkeypatch.chdir(tmp_path)
6362
assert main(["gen"]) == 0
6463
assert main(["verify"]) == 0 # bare verify → --codegen (config-driven), plus --templates

‎server/python/tests/codegen/test_cli_verify_requirements.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,12 @@ def test_a_model_with_no_requirement_and_no_generators_selected_still_exits_0_an
434434
assert _verify_with_nothing_selected(tmp_path, meta_dir) == 0
435435
captured = capsys.readouterr()
436436
assert captured.out == _NOTHING_TO_CHECK_OUT
437-
# stderr holds the one line a bare `verify` has always printed, and nothing else.
438-
(note,) = captured.err.splitlines()
439-
assert note.startswith("metaobjects verify — running --codegen (default).")
437+
# stderr holds the two lines a bare `verify` over a named <metadata_dir> prints (the default
438+
# gate-set note, then the template gate's skip note, since no --prompts root is named), and
439+
# nothing else.
440+
note, skipped = captured.err.splitlines()
441+
assert note.startswith("metaobjects verify — running --codegen --templates (default).")
442+
assert skipped.startswith("metaobjects verify — template gate skipped:")
440443

441444

442445
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)