diff --git a/tests/unit/test_documentation_consistency.py b/tests/unit/test_documentation_consistency.py index ea32fbd..7fefcaa 100644 --- a/tests/unit/test_documentation_consistency.py +++ b/tests/unit/test_documentation_consistency.py @@ -120,6 +120,7 @@ TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY = ( "test_training_m56_release_index_required_snippet_inventory_source_shape_rejects_dynamic_fixtures", "test_training_m57_release_index_required_snippet_inventory_source_shape_diagnostics_are_locked", "test_training_m58_release_index_required_snippet_inventory_source_shape_accepts_literal_fixtures", + "test_training_m59_release_index_required_snippet_inventory_source_shape_preserves_literal_order", "test_training_m53_release_index_doc_category_coverage_is_exact", "test_training_case_product_doc_reflects_current_m40_maturity", ) @@ -570,6 +571,9 @@ class DocumentationConsistencyTests(unittest.TestCase): "required_snippet_inventory_source_shape_positive_fixtures": ( "test_training_m58_release_index_required_snippet_inventory_source_shape_accepts_literal_fixtures" ), + "required_snippet_inventory_source_shape_literal_order": ( + "test_training_m59_release_index_required_snippet_inventory_source_shape_preserves_literal_order" + ), "per_doc_helper_exact_category_coverage": ( "test_training_m53_release_index_doc_category_coverage_is_exact" ), @@ -724,6 +728,7 @@ class DocumentationConsistencyTests(unittest.TestCase): "test_training_m56_release_index_required_snippet_inventory_source_shape_rejects_dynamic_fixtures", "test_training_m57_release_index_required_snippet_inventory_source_shape_diagnostics_are_locked", "test_training_m58_release_index_required_snippet_inventory_source_shape_accepts_literal_fixtures", + "test_training_m59_release_index_required_snippet_inventory_source_shape_preserves_literal_order", "test_training_m53_release_index_doc_category_coverage_is_exact", "test_training_case_product_doc_reflects_current_m40_maturity", ) @@ -1096,6 +1101,44 @@ TRAINING_M41_RELEASE_INDEX_REQUIRED_SNIPPET_INVENTORY = ( self.assertEqual(source_group_order, expected_categories) self.assertNotEqual(source_group_order, tuple(sorted(source_group_order))) + def test_training_m59_release_index_required_snippet_inventory_source_shape_preserves_literal_order( + self, + ) -> None: + source = """ +TRAINING_M41_RELEASE_INDEX_REQUIRED_SNIPPET_INVENTORY = ( + ( + "literal_order_third_category", + ( + "third literal order signal", + ), + ), + ( + "literal_order_first_category", + ( + "first literal order signal", + ), + ), + ( + "literal_order_second_category", + ( + "second literal order signal", + ), + ), +) +""" + expected_categories = ( + "literal_order_third_category", + "literal_order_first_category", + "literal_order_second_category", + ) + + source_group_order = ( + self._release_index_required_snippet_inventory_source_categories(source) + ) + + self.assertNotEqual(expected_categories, tuple(sorted(expected_categories))) + self.assertEqual(source_group_order, expected_categories) + def test_training_m53_release_index_doc_category_coverage_is_exact(self) -> None: inventory = TRAINING_M41_RELEASE_INDEX_REQUIRED_SNIPPET_INVENTORY inventory_by_category = dict(inventory)