tenseleyflow/documentlanguagemodel / 687bb14

Browse files

test(smoke): migrate stub assertion to "all commands wired" — Sprint 14 shipped the last stub

Authored by espadonne
SHA
687bb143f1e23f27a2f42b6bbe510276e9399582
Parents
9597e69
Tree
942f7b3

1 changed file

StatusFile+-
M tests/test_smoke.py 20 11
tests/test_smoke.pymodified
@@ -4,7 +4,6 @@ from __future__ import annotations
4
 
4
 
5
 import subprocess
5
 import subprocess
6
 import sys
6
 import sys
7
-from pathlib import Path
8
 
7
 
9
 from typer.testing import CliRunner
8
 from typer.testing import CliRunner
10
 
9
 
@@ -45,19 +44,29 @@ def test_cli_help_lists_all_v1_subcommands() -> None:
45
         assert name in result.output, f"`dlm --help` missing subcommand {name!r}"
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:
47
+def test_cli_has_every_documented_subcommand() -> None:
49
-    """Still-stubbed subcommands (Sprint 14's `dlm pack`) must raise with a
48
+    """Every v1.0 subcommand is wired (Sprint 14 landed the last pair).
50
-    sprint pointer so `dlm --help` stays self-documenting about unreleased work.
51
 
49
 
52
-    Updated each time a stub lands: this test migrates to the *next*
50
+    Replaces the older 'stub raises NotImplementedError' smoke: no stubs
53
-    un-landed command so the smoke invariant outlives any one sprint.
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
     runner = CliRunner()
54
     runner = CliRunner()
56
-    doc = tmp_path / "mydoc.dlm"
55
+    result = runner.invoke(app, ["--help"])
57
-    result = runner.invoke(app, ["pack", str(doc)], catch_exceptions=True)
56
+    assert result.exit_code == 0, result.output
58
-    assert result.exit_code != 0
57
+    expected_commands = {
59
-    assert isinstance(result.exception, NotImplementedError)
58
+        "init",
60
-    assert "Sprint 14" in str(result.exception)
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
 def test_python_module_entrypoint_runs() -> None:
72
 def test_python_module_entrypoint_runs() -> None: