diff --git a/tests/unit/test_documentation_consistency.py b/tests/unit/test_documentation_consistency.py index 63ea43e..5dc2189 100644 --- a/tests/unit/test_documentation_consistency.py +++ b/tests/unit/test_documentation_consistency.py @@ -704,6 +704,18 @@ class DocumentationConsistencyTests(unittest.TestCase): self.assertIsInstance(missing_by_doc["complete-release-index.md"], tuple) self.assertEqual(docs_by_name, original_docs_by_name) + def test_training_m49_release_index_per_doc_helper_handles_empty_docs_without_mutation(self) -> None: + complete_release_doc = "\n".join(TRAINING_M41_RELEASE_INDEX_DOC_SNIPPETS) + docs_by_name = {"complete-release-index.md": complete_release_doc} + original_docs_by_name = dict(docs_by_name) + + empty_missing_by_doc = _release_index_missing_required_snippets_by_doc({}) + complete_missing_by_doc = _release_index_missing_required_snippets_by_doc(docs_by_name) + + self.assertEqual(empty_missing_by_doc, {}) + self.assertEqual(docs_by_name, original_docs_by_name) + self.assertEqual(complete_missing_by_doc["complete-release-index.md"], ()) + def test_training_m41_release_index_inventory_shape_is_stable(self) -> None: module_tree = ast.parse(Path(__file__).read_text(encoding="utf-8")) inventory_assignments = [