executor / tests.sh
eggie5-adyen's picture
added new fees files
97f8d30
raw
history blame contribute delete
729 Bytes
# Create a session and capture the session ID
SESSION_ID=$(curl -s -X POST https://adyen-executor.hf.space/create_session | yq -r '.session_id')
echo "Created session: $SESSION_ID"
# Execute some basic code
curl -X POST https://adyen-executor.hf.space/execute/$SESSION_ID \
-H "Content-Type: application/json" \
-d '{"code": "x = 42\nprint(f\"The value is {x}\")"}'
# Execute code that uses the previous variable
curl -X POST https://adyen-executor.hf.space/execute/$SESSION_ID \
-H "Content-Type: application/json" \
-d '{"code": "print(f\"x is still {x}\")"}'
# List sessions
curl https://adyen-executor.hf.space/list_sessions
# Shutdown the session
curl -X POST https://adyen-executor.hf.space/shutdown/$SESSION_ID