43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for exception handling module
|
|
Resource common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Test Cases ***
|
|
Classify Validation Error
|
|
[Documentation] Verify ValidationError classifies as 422
|
|
${result}= Run Process ${PYTHON} ${WORKSPACE}/robot/helper_security_exceptions.py
|
|
... classify validation
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} code=422
|
|
|
|
Classify Database Error
|
|
[Documentation] Verify DatabaseError classifies as 522
|
|
${result}= Run Process ${PYTHON} ${WORKSPACE}/robot/helper_security_exceptions.py
|
|
... classify database
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} code=522
|
|
|
|
Redact Secret Key
|
|
[Documentation] Verify api_key is redacted
|
|
${result}= Run Process ${PYTHON} ${WORKSPACE}/robot/helper_security_exceptions.py
|
|
... redact api_key sk-secret12345
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} ***REDACTED***
|
|
|
|
Wrap Bare Exception
|
|
[Documentation] Verify bare Exception is wrapped in CleverAgentsError
|
|
${result}= Run Process ${PYTHON} ${WORKSPACE}/robot/helper_security_exceptions.py
|
|
... wrap unexpected-crash
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} is_ca=True
|
|
|
|
Redact Non-Secret Key
|
|
[Documentation] Verify non-secret values pass through
|
|
${result}= Run Process ${PYTHON} ${WORKSPACE}/robot/helper_security_exceptions.py
|
|
... redact plan_id 01PLAN001
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} 01PLAN001
|
|
Should Not Contain ${result.stdout} REDACTED
|