From fcc780bf1b9778cc99279c20be2945e8622ffcb3 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Sun, 31 May 2026 17:10:35 -0400 Subject: [PATCH] fix(cli): align --url validation error message with test expectations The Behave test expected the error message to contain '--url is only valid for git resources' but the code was producing '--url only for git resources'. Updated the validation error message to match the test assertion. Also updated the Robot Framework integration test to expect the corrected message, ensuring consistency across both test suites. Fixes the failing Behave scenario: 'Using --url with a non-git resource type is rejected' by correcting the error message text output from the CLI. ISSUES CLOSED: #6322 --- robot/resource_cli.robot | 2 +- src/cleveragents/cli/commands/resource.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/robot/resource_cli.robot b/robot/resource_cli.robot index a7642c084..abf03d9ef 100644 --- a/robot/resource_cli.robot +++ b/robot/resource_cli.robot @@ -53,4 +53,4 @@ Git Resource Add URL Flag Validation Rejects Non Git Types ... timeout=120s on_timeout=kill stderr=STDOUT Log ${result.stdout} Should Not Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} --url only for git resources + Should Contain ${result.stdout} --url is only valid for git resources diff --git a/src/cleveragents/cli/commands/resource.py b/src/cleveragents/cli/commands/resource.py index 5fecb6294..0c57fae46 100644 --- a/src/cleveragents/cli/commands/resource.py +++ b/src/cleveragents/cli/commands/resource.py @@ -699,7 +699,8 @@ def resource_add( if url is not None: if type_name != "git": console.print( - "[red]Validation error:[/red] --url only for git resources." + "[red]Validation error:[/red] " + "--url is only valid for git resources." ) raise typer.Abort() url_value = url.strip()