*** Settings ***
Documentation    Smoke tests for Action CLI spec alignment (config-only create, no available command)
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_action_cli_spec.py

*** Test Cases ***
Action Create Requires Config Flag
    [Documentation]    Verify that ``action create`` requires the ``--config`` flag
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    create-requires-config    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-create-requires-config-ok

Action Create Rejects Legacy Name Flag
    [Documentation]    Verify that ``action create --name`` is rejected
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    create-rejects-name    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-legacy-flag-rejected

Action Available Command Removed
    [Documentation]    Verify that the ``available`` subcommand is removed
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    available-removed    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-available-removed-ok

Action List Accepts Namespace And State Filters
    [Documentation]    Verify that ``action list`` accepts ``--namespace`` and ``--state``
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    list-filters    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-list-filters-ok

Action Show Accepts Namespaced Name
    [Documentation]    Verify that ``action show`` accepts a namespaced name argument
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    show-name    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-show-name-ok

Action Archive Accepts Namespaced Name
    [Documentation]    Verify that ``action archive`` accepts a namespaced name argument
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    archive-name    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    action-cli-archive-name-ok
