Answer stability round 1: 1 🔴, 4 🟡 (0 misread); check Goals and Audience on the document that is sent, report an unknown section as a Failure, refuse a section body that holds a heading, correct the stale read-only text

This commit is contained in:
2026-11-18 10:39:22 +01:00
parent 0755291112
commit fe351d3ed4
12 changed files with 77 additions and 30 deletions
+11 -2
View File
@@ -74,8 +74,17 @@ class SectionsTest(unittest.TestCase):
def test_refuses_a_repeated_section_and_a_name_that_is_no_section(self) -> None:
self.assertIsInstance(with_section("## Scoring\nA\n\n## Scoring\nB\n", "Scoring", "C"), Failure)
with self.assertRaisesRegex(ValueError, "Language is not a section.*Goals, Audience, Scoring, Decisions"):
read_section(DESCRIPTION, "Language")
for found in (read_section(DESCRIPTION, "Language"), with_section(DESCRIPTION, "Language", "Swedish")):
assert isinstance(found, Failure), found
self.assertIn("Language is not a section of an epic's description; the sections are Goals, Audience, Scoring, Decisions", found.reason)
def test_refuses_a_body_that_would_start_another_section(self) -> None:
for body in ("A\n## Goals\nB", "# Title"):
with self.subTest(body):
found = with_section(DESCRIPTION, "Scoring", body)
assert isinstance(found, Failure), found
self.assertIn("level 1 or 2 heading", found.reason)
self.assertIsInstance(with_section(DESCRIPTION, "Scoring", "```\n## Goals\n```\n### Bar"), str)
class LanguageTest(unittest.TestCase):