From e1f4f14bb53129be3e75f6da7b3c5a3ab2e40cdf Mon Sep 17 00:00:00 2001 From: yuqei Date: Fri, 1 May 2026 02:52:06 -0400 Subject: [PATCH] test: bridge release guard exactness inventory --- tests/unit/test_documentation_consistency.py | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/unit/test_documentation_consistency.py b/tests/unit/test_documentation_consistency.py index ff62152..9053b42 100644 --- a/tests/unit/test_documentation_consistency.py +++ b/tests/unit/test_documentation_consistency.py @@ -128,6 +128,7 @@ TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY = ( "test_training_m64_release_index_source_shape_fixture_guard_methods_accept_valid_literal_sources", "test_training_m65_release_index_source_shape_fixture_guard_methods_constant_inventory_exactness_self_lock", "test_training_m66_release_index_source_shape_fixture_guard_methods_constant_source_exactness_self_lock", + "test_training_m67_release_index_source_shape_fixture_guard_methods_constant_inventory_source_exactness_bridge_self_lock", "test_training_m53_release_index_doc_category_coverage_is_exact", "test_training_case_product_doc_reflects_current_m40_maturity", ) @@ -614,6 +615,9 @@ class DocumentationConsistencyTests(unittest.TestCase): "required_snippet_inventory_source_shape_fixture_constant_source_exactness": ( "test_training_m66_release_index_source_shape_fixture_guard_methods_constant_source_exactness_self_lock" ), + "required_snippet_inventory_source_shape_fixture_constant_exactness_bridge": ( + "test_training_m67_release_index_source_shape_fixture_guard_methods_constant_inventory_source_exactness_bridge_self_lock" + ), "per_doc_helper_exact_category_coverage": ( "test_training_m53_release_index_doc_category_coverage_is_exact" ), @@ -776,6 +780,7 @@ class DocumentationConsistencyTests(unittest.TestCase): "test_training_m64_release_index_source_shape_fixture_guard_methods_accept_valid_literal_sources", "test_training_m65_release_index_source_shape_fixture_guard_methods_constant_inventory_exactness_self_lock", "test_training_m66_release_index_source_shape_fixture_guard_methods_constant_source_exactness_self_lock", + "test_training_m67_release_index_source_shape_fixture_guard_methods_constant_inventory_source_exactness_bridge_self_lock", "test_training_m53_release_index_doc_category_coverage_is_exact", "test_training_case_product_doc_reflects_current_m40_maturity", ) @@ -1167,6 +1172,53 @@ class DocumentationConsistencyTests(unittest.TestCase): self.assertEqual(len(source_method_names), len(set(source_method_names))) self.assertIn(guard_name, TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY) + def test_training_m67_release_index_source_shape_fixture_guard_methods_constant_inventory_source_exactness_bridge_self_lock( + self, + ) -> None: + inventory_exactness_guard = ( + "test_training_m65_release_index_source_shape_fixture_guard_methods_constant_inventory_exactness_self_lock" + ) + source_exactness_guard = ( + "test_training_m66_release_index_source_shape_fixture_guard_methods_constant_source_exactness_self_lock" + ) + guard_name = ( + "test_training_m67_release_index_source_shape_fixture_guard_methods_constant_inventory_source_exactness_bridge_self_lock" + ) + exactness_guard_names = (inventory_exactness_guard, source_exactness_guard) + test_case_name = f"{type(self).__module__}.{type(self).__qualname__}" + inventory_exactness_index = ( + TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY.index( + inventory_exactness_guard + ) + ) + source_exactness_index = ( + TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY.index( + source_exactness_guard + ) + ) + + self.assertIn(guard_name, TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY) + for method_name in exactness_guard_names: + with self.subTest(method_name=method_name): + loader = unittest.TestLoader() + suite = loader.loadTestsFromName(f"{test_case_name}.{method_name}") + + self.assertEqual( + TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY.count( + method_name + ), + 1, + ) + self.assertEqual(loader.errors, []) + self.assertEqual(suite.countTestCases(), 1) + self.assertEqual(source_exactness_index, inventory_exactness_index + 1) + self.assertEqual( + TRAINING_M41_RELEASE_INDEX_GUARD_TEST_INVENTORY[ + inventory_exactness_index : source_exactness_index + 1 + ], + exactness_guard_names, + ) + def test_training_m47_release_index_per_doc_helper_inventory_self_lock_is_current(self) -> None: helper_name = "_release_index_missing_required_snippets_by_doc" docs_guard_name = "test_training_readmes_expose_m1_m40_release_index_without_raw_test_modules"