", html)
self.assertIn("| Field | ", html)
self.assertIn("Status | ", html)
self.assertNotIn("| Field |", html)
def test_a_fenced_block_renders_as_a_code_block(self):
install = self.page("/guides/install/")
self.assertIn("Task title", html)
self.assertIn("**Depends on:** 03, 05", html)
@needs_renderer
class ARenderedSliceKeepsItsShape(ScratchCase):
"""All three constructs in one slice, so the renderer is tested on the
shapes rather than on the sections that happen to have them today."""
BODY = """
| Stage | What it means |
| --- | --- |
| `review/` | built, not yet trusted |
```bash
./.task-manager/start.sh
```
- the board
- narrates moves
- opens PRs
- and never merges
"""
def test_a_table_a_fence_and_a_nested_list_all_survive(self):
(self.repo.root / "SOURCE.md").write_text(
f"# Doc\n\n## Section\n{self.BODY}\n", encoding="utf-8")
self.repo.pages({
"path": "/shapes/", "title": "Shapes", "layout": "article",
"section": "Concepts", "description": "one of each.",
"source": "SOURCE.md", "from": "## Section",
})
result = self.repo.build()
self.assertEqual(0, result.returncode, result.stderr)
html = (self.repo.out / "shapes" / "index.html").read_text("utf-8")
self.assertIn("| Stage | ", html)
self.assertIn("review/", html)
self.assertIn(" inside an , not two flat lists.
self.assertRegex(html, r"the board\s*")
self.assertIn("- opens PRs
", html)
@needs_renderer
class DriftOnARealConceptPage(ScratchCase):
"""Inherited from task 31 and worth asserting on a page that ships:
a section renamed in AGENTS.md stops the build, naming the route."""
def test_renaming_task_file_format_names_its_route(self):
self.repo.edit("AGENTS.md", "## Task file format",
"## The task file")
result = self.repo.build()
self.assertNotEqual(0, result.returncode,
"a renamed section built cleanly")
self.assertIn("/concepts/task-files/", result.stderr)
self.assertIn("## Task file format", result.stderr)
self.assertFalse(self.repo.out.exists(),
"a failed build wrote pages anyway")
def test_renaming_agent_adapters_names_its_route(self):
self.repo.edit("AGENTS.md", "## Agent adapters", "## Adapters")
result = self.repo.build()
self.assertNotEqual(0, result.returncode)
self.assertIn("/concepts/adapters/", result.stderr)
if __name__ == "__main__":
unittest.main()