diff --git a/features/steps/a2a_module_rename_standardization_steps.py b/features/steps/a2a_module_rename_standardization_steps.py index 796ea5940..a3d76d1a4 100644 --- a/features/steps/a2a_module_rename_standardization_steps.py +++ b/features/steps/a2a_module_rename_standardization_steps.py @@ -67,6 +67,7 @@ def _scan_dir_for_pattern(root: Path, pattern_str: str) -> int: # ── Given steps ──────────────────────────────────────────────────────────── + @given('the "a2a" Python package is importable from "cleveragents.a2a"') def step_a2a_importable(context: Any) -> None: """Ensure cleveragents.a2a can be imported.""" @@ -78,10 +79,12 @@ def step_a2a_importable(context: Any) -> None: # ── When steps ───────────────────────────────────────────────────────────── + @when('I import "cleveragents.a2a"') def step_import_a2a(context: Any) -> None: """Import the a2a package and store it on context.""" import cleveragents.a2a + context._a2a_module = cleveragents.a2a @@ -105,7 +108,7 @@ def step_scan_a2a_python_files(context: Any) -> None: context._a2a_scan_root = str(a2a_dir) -@when("I search for the legacy prefix string \"ACP\"") +@when('I search for the legacy prefix string "ACP"') def step_search_acp_pattern(context: Any) -> None: """Perform recursive scan and store results.""" count = _scan_dir_for_pattern(Path(context._a2a_scan_root), "ACP") @@ -116,13 +119,15 @@ def step_search_acp_pattern(context: Any) -> None: def step_read_a2a_docstring(context: Any) -> None: """Store the a2a package docstring on context.""" import cleveragents.a2a as a2a_pkg + assert a2a_pkg.__doc__ is not None, "cleveragents.a2a has no __doc__" context._a2a_docstring = a2a_pkg.__doc__ # ── Then steps ───────────────────────────────────────────────────────────── -@then('every symbol should resolve to a non-None object') + +@then("every symbol should resolve to a non-None object") def step_all_symbols_resolved(context: Any) -> None: """Assert every expected symbol is present and non-None.""" module = context._a2a_module @@ -134,7 +139,7 @@ def step_all_symbols_resolved(context: Any) -> None: assert not missing, f"Missing symbols: {missing}" -@then('the count of exported symbols should equal 22') +@then("the count of exported symbols should equal 22") def step_symbol_count_is_22(context: Any) -> None: """Assert __all__ has exactly 22 entries.""" actual_all = context._a2a_module.__all__ @@ -143,7 +148,7 @@ def step_symbol_count_is_22(context: Any) -> None: ) -@then("zero instances of \"ACP\" should be found") +@then('zero instances of "ACP" should be found') def step_zero_acp_references(context: Any) -> None: """Assert zero ACP remnants were found.""" assert context._acp_references_found == 0, ( @@ -177,6 +182,7 @@ def step_docstring_references_adr(context: Any) -> None: @then('the docstring should NOT contain any mentions of "ACP protocol"') def step_no_acp_protocol_mention(context: Any) -> None: """Assert docstring does not reference ACP.""" - assert "ACP(protocol)" not in context._a2a_docstring and "ACP protocol" not in context._a2a_docstring, ( - f"Docstring contains legacy 'ACP protocol':\n{context._a2a_docstring[:500]}" - ) + assert ( + "ACP(protocol)" not in context._a2a_docstring + and "ACP protocol" not in context._a2a_docstring + ), f"Docstring contains legacy 'ACP protocol':\n{context._a2a_docstring[:500]}"