diff --git a/features/steps/actor_context_cmds_steps.py b/features/steps/actor_context_cmds_steps.py index 61acf9a55..0150e4dca 100644 --- a/features/steps/actor_context_cmds_steps.py +++ b/features/steps/actor_context_cmds_steps.py @@ -9,7 +9,7 @@ import tempfile from pathlib import Path from typing import Any -from behave import given, step, then, when +from behave import given, then, when from typer.testing import CliRunner from cleveragents.cli.commands.actor_context import app as actor_context_app @@ -604,7 +604,7 @@ def step_list_regex(context, regex): ) -@when('I run actor context list --format "{fmt}"') +@when("I run actor context list --format {fmt}") def step_list_format(context, fmt): context.result = context.runner.invoke( actor_context_app, @@ -623,19 +623,32 @@ def step_list_format(context, fmt): # --------------------------------------------------------------------------- -@step('I run actor context show "{name}"{fmt}') -def step_show(context, name, fmt=None): +@when('I run actor context show "{name}"') +def step_show(context, name): args = [ "show", name, "--context-dir", str(context.context_dir), ] - if fmt is not None: - args.extend(["--format", fmt]) context.result = context.runner.invoke(actor_context_app, args) +@when('I run actor context show "{name}" --format {fmt}') +def step_show_format(context, name, fmt): + context.result = context.runner.invoke( + actor_context_app, + [ + "show", + name, + "--context-dir", + str(context.context_dir), + "--format", + fmt, + ], + ) + + # --------------------------------------------------------------------------- # Then — list / show success and failure assertions # ---------------------------------------------------------------------------