@@ -4,7 +4,6 @@ from __future__ import annotations |
| 4 | 4 | |
| 5 | 5 | import subprocess |
| 6 | 6 | import sys |
| 7 | | -from pathlib import Path |
| 8 | 7 | |
| 9 | 8 | from typer.testing import CliRunner |
| 10 | 9 | |
@@ -45,19 +44,29 @@ def test_cli_help_lists_all_v1_subcommands() -> None: |
| 45 | 44 | assert name in result.output, f"`dlm --help` missing subcommand {name!r}" |
| 46 | 45 | |
| 47 | 46 | |
| 48 | | -def test_cli_subcommand_stub_raises_notimplementederror(tmp_path: Path) -> None: |
| 49 | | - """Still-stubbed subcommands (Sprint 14's `dlm pack`) must raise with a |
| 50 | | - sprint pointer so `dlm --help` stays self-documenting about unreleased work. |
| 47 | +def test_cli_has_every_documented_subcommand() -> None: |
| 48 | + """Every v1.0 subcommand is wired (Sprint 14 landed the last pair). |
| 51 | 49 | |
| 52 | | - Updated each time a stub lands: this test migrates to the *next* |
| 53 | | - un-landed command so the smoke invariant outlives any one sprint. |
| 50 | + Replaces the older 'stub raises NotImplementedError' smoke: no stubs |
| 51 | + remain after Sprints 13 + 14. Re-introduce a targeted stub test if a |
| 52 | + future sprint re-adds a placeholder command. |
| 54 | 53 | """ |
| 55 | 54 | runner = CliRunner() |
| 56 | | - doc = tmp_path / "mydoc.dlm" |
| 57 | | - result = runner.invoke(app, ["pack", str(doc)], catch_exceptions=True) |
| 58 | | - assert result.exit_code != 0 |
| 59 | | - assert isinstance(result.exception, NotImplementedError) |
| 60 | | - assert "Sprint 14" in str(result.exception) |
| 55 | + result = runner.invoke(app, ["--help"]) |
| 56 | + assert result.exit_code == 0, result.output |
| 57 | + expected_commands = { |
| 58 | + "init", |
| 59 | + "train", |
| 60 | + "prompt", |
| 61 | + "export", |
| 62 | + "pack", |
| 63 | + "unpack", |
| 64 | + "doctor", |
| 65 | + "show", |
| 66 | + "migrate", |
| 67 | + } |
| 68 | + for name in expected_commands: |
| 69 | + assert name in result.output, f"`dlm --help` missing {name!r}" |
| 61 | 70 | |
| 62 | 71 | |
| 63 | 72 | def test_python_module_entrypoint_runs() -> None: |