*** Settings ***
Documentation    Smoke tests for project context set --execution-env-priority flag (Bug #1079)
...
...              Regression tests for bug #1079: verifies the ``--execution-env-priority``
...              flag on ``project context set`` works correctly.
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment
Force Tags       tdd_issue    tdd_issue_1079

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

*** Test Cases ***
Project Context Set Accepts Execution Env Priority Override
    [Documentation]    Verify that ``project context set --execution-env-priority override``
    ...    works with ``--execution-environment``. Currently fails due to bug #1079.
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    set-env-priority-override    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    project-context-set-env-priority-override-ok

Project Context Set Accepts Execution Env Priority Fallback
    [Documentation]    Verify that ``project context set --execution-env-priority fallback``
    ...    works with ``--execution-environment``. Currently fails due to bug #1079.
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    set-env-priority-fallback    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    project-context-set-env-priority-fallback-ok

Project Context Set Persists Execution Env Priority
    [Documentation]    Verify that execution_env_priority is persisted and retrievable
    ...    after ``project context set``. Currently fails due to bug #1079.
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    set-env-priority-persists    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    project-context-set-env-priority-persists-ok
