Files
cleveragents-core/robot/routing_prefix_stripping.robot

79 lines
2.9 KiB
Plaintext

*** Settings ***
Documentation Integration tests for routing prefix stripping functionality
Library Process
Library OperatingSystem
Library String
*** Settings ***
Resource v2_paths.resource
*** Variables ***
${DISCOVERY_CONFIG} ${V2_CONFIG_DIR}/routing_test_discovery_response.yaml
${BRAINSTORM_CONFIG} ${V2_CONFIG_DIR}/routing_test_goto_brainstorming.yaml
${NO_PREFIX_CONFIG} ${V2_CONFIG_DIR}/routing_test_no_prefix.yaml
${SET_TOPIC_CONFIG} ${V2_CONFIG_DIR}/routing_test_set_topic.yaml
${RUN_CMD} python -m cleveragents actor run
*** Test Cases ***
Routing Prefix Stripping In Application
[Documentation] Test that internal routing prefixes are stripped from output
[Tags] routing prefix integration
# Run the application with DISCOVERY_RESPONSE prefix
${result}= Run Process python -m cleveragents actor run
... -c ${DISCOVERY_CONFIG}
... --unsafe
... --allow-rxpy-in-run-mode
... -p test input
... stderr=STDOUT
... timeout=30s
# Check that the output does NOT contain the prefix
Should Not Contain ${result.stdout} DISCOVERY_RESPONSE:
Should Contain ${result.stdout} What topic would you like to write about?
Multiple Routing Prefixes Are Stripped
[Documentation] Test that various routing prefixes are all stripped correctly
[Tags] routing prefix integration
# Test GOTO_BRAINSTORMING prefix
${result}= Run Process python -m cleveragents actor run
... -c ${BRAINSTORM_CONFIG}
... --unsafe
... --allow-rxpy-in-run-mode
... -p test input
... stderr=STDOUT
... timeout=30s
Should Not Contain ${result.stdout} GOTO_BRAINSTORMING:
Should Contain ${result.stdout} Let's brainstorm ideas
Content Without Prefix Remains Unchanged
[Documentation] Test that content without routing prefixes is not modified
[Tags] routing prefix integration
${result}= Run Process python -m cleveragents actor run
... -c ${NO_PREFIX_CONFIG}
... --unsafe
... --allow-rxpy-in-run-mode
... -p test input
... stderr=STDOUT
... timeout=30s
Should Contain ${result.stdout} This is normal text without any prefix
SET Prefix Family Stripped
[Documentation] Test that SET_* prefixes used for state updates are stripped
[Tags] routing prefix integration
${result}= Run Process python -m cleveragents actor run
... -c ${SET_TOPIC_CONFIG}
... --unsafe
... --allow-rxpy-in-run-mode
... -p test input
... stderr=STDOUT
... timeout=30s
Should Not Contain ${result.stdout} SET_TOPIC:
Should Contain ${result.stdout} Neural networks in cognitive science