Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions server/python/tests/codegen/test_cli_config_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
from __future__ import annotations

import json
import shutil
from pathlib import Path

from metaobjects.cli import main
from tests.codegen.gen_suite import GEN_SUITE
from tests.codegen.config_helpers import as_config

FITNESS = (
Path(__file__).parents[4]
/ "fixtures"
/ "persistence-conformance"
/ "canonical"
/ "meta.fitness.json"
)
CANONICAL = Path(__file__).parents[4] / "fixtures" / "persistence-conformance" / "canonical"
FITNESS = CANONICAL / "meta.fitness.json"

TWO_TARGETS = """
targets:
Expand Down Expand Up @@ -59,6 +55,9 @@ def test_verify_codegen_no_args_in_sync(tmp_path: Path) -> None:

def test_verify_codegen_bare_defaults_to_codegen(tmp_path: Path, monkeypatch) -> None:
_project(tmp_path)
# Bare verify also runs the template gate against `prompts/` (the default root), and the
# fitness model's `template.prompt` refs resolve there.
shutil.copytree(CANONICAL / "prompts", tmp_path / "prompts")
monkeypatch.chdir(tmp_path)
assert main(["gen"]) == 0
assert main(["verify"]) == 0 # bare verify → --codegen (config-driven), plus --templates
Expand Down
9 changes: 6 additions & 3 deletions server/python/tests/codegen/test_cli_verify_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,12 @@ def test_a_model_with_no_requirement_and_no_generators_selected_still_exits_0_an
assert _verify_with_nothing_selected(tmp_path, meta_dir) == 0
captured = capsys.readouterr()
assert captured.out == _NOTHING_TO_CHECK_OUT
# stderr holds the one line a bare `verify` has always printed, and nothing else.
(note,) = captured.err.splitlines()
assert note.startswith("metaobjects verify — running --codegen (default).")
# stderr holds the two lines a bare `verify` over a named <metadata_dir> prints (the default
# gate-set note, then the template gate's skip note, since no --prompts root is named), and
# nothing else.
note, skipped = captured.err.splitlines()
assert note.startswith("metaobjects verify — running --codegen --templates (default).")
assert skipped.startswith("metaobjects verify — template gate skipped:")


# ---------------------------------------------------------------------------
Expand Down
Loading