diff --git a/features/steps/sandbox_create_for_plan_steps.py b/features/steps/sandbox_create_for_plan_steps.py index 21fa9a44c..49e1cb5b9 100644 --- a/features/steps/sandbox_create_for_plan_steps.py +++ b/features/steps/sandbox_create_for_plan_steps.py @@ -116,9 +116,13 @@ def step_call_create_sandbox(context: Context) -> None: "cleveragents.application.container.get_container", return_value=context.scfp_container, ): - context.scfp_sandbox_root, context.scfp_sandbox_obj = _create_sandbox_for_plan( + sandbox_root, sandbox_infos = _create_sandbox_for_plan( _PLAN_ID, context.scfp_service ) + context.scfp_sandbox_root = sandbox_root + # _create_sandbox_for_plan returns (str | None, list[_SandboxInfo]). + # Extract the first sandbox object from the list, or None if empty. + context.scfp_sandbox_obj = sandbox_infos[0].sandbox_obj if sandbox_infos else None if context.scfp_sandbox_obj is not None: context.add_cleanup(context.scfp_sandbox_obj.cleanup) @@ -166,3 +170,4 @@ def step_sandbox_root_differs(context: Context) -> None: @then("the cleanup call should complete without error for scfp") def step_cleanup_no_error(context: Context) -> None: assert context.scfp_cleanup_done is True +