Two things the sweep could not see
A block that renders to nothing still counted toward the separator, so `config restore --dry-run` opened with a blank line it did not have — the plan is a listing under an outcome that says everything it has to say in the exit status. The separator now counts what was drawn. And the device inventory declared `port` and `address` in its rows and never in its columns, so both fell out of the document: a caller had to parse the target for a colon to find out which transport it was holding. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e3ae668f4a
commit
5215a1b76c
3 files changed
+33
-3
No files matched your search
@@ -270,6 +270,24 @@ def test_a_block_drawn_only_for_a_person_never_reaches_the_document() -> None:
|
||||
assert _json(facts, summary) == {"packets": 2}
|
||||
|
||||
|
||||
def test_a_block_that_prints_nothing_leaves_no_blank_line_where_it_stood() -> None:
|
||||
"""The separator is counted off what was drawn, not off the block index.
|
||||
|
||||
``config restore --dry-run`` states its outcome silently and its plan as a listing, and
|
||||
counting positions instead opened the command with an empty line — output it did not
|
||||
have, in whatever was reading it.
|
||||
"""
|
||||
silent = Facts(
|
||||
key="restore", fields=(fields.flag("dry_run", "dry_run"),), values={}, shape=SILENT
|
||||
)
|
||||
plan = Listing(
|
||||
key="operations",
|
||||
columns=(fields.word("operation", "OPERATION"),),
|
||||
rows=[{"operation": "set"}],
|
||||
)
|
||||
assert _plain(silent, plan).splitlines()[0] == "OPERATION"
|
||||
|
||||
|
||||
# -- the document's own rules ----------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user