fix(test): patch get_container at module level after import move
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 42s
CI / build (pull_request) Successful in 3m47s
CI / lint (pull_request) Successful in 3m55s
CI / quality (pull_request) Successful in 4m20s
CI / typecheck (pull_request) Successful in 4m32s
CI / security (pull_request) Successful in 4m42s
CI / e2e_tests (pull_request) Successful in 7m0s
CI / integration_tests (pull_request) Successful in 8m20s
CI / unit_tests (pull_request) Successful in 8m52s
CI / docker (pull_request) Successful in 1m33s
CI / coverage (pull_request) Successful in 13m22s
CI / status-check (pull_request) Successful in 3s

The G2 fix moved get_container to a top-level import in plan.py.
The Behave step must now patch 'cleveragents.cli.commands.plan.get_container'
instead of 'cleveragents.application.container.get_container' so the mock
is resolved at the call site.

ISSUES CLOSED: #9230
This commit is contained in:
2026-04-20 14:27:44 +00:00
parent 770dee16b8
commit 805fef32a4
@@ -112,7 +112,7 @@ def step_call_cleanup(context: object, plan_id: str) -> None:
from cleveragents.cli.commands.plan import _cleanup_sandbox_for_plan
with patch(
"cleveragents.application.container.get_container",
"cleveragents.cli.commands.plan.get_container",
return_value=context.cwc_container,
):
_cleanup_sandbox_for_plan(plan_id, context.cwc_service)