360 Secure SkillHub
360 安全技能中心

agentscope-test-fixture-generator

通过 Python 脚本按 sequential、parallel、team、dialogue 等模式,为 AgentScope 2.0 项目生成模拟智能体配置、示例管道配置、mock 响应数据与 pytest 测试脚手架,便于单元测试和 CI;OPENAI_API_KEY 仅用于可选的配置校验。

trend0522
trend0522
热度 7.65
最近更新 2026-10-03 10:04:38
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:代码生成 / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agentscope-test-fixture-generator
Metadata
name
agentscope-test-fixture-generator
description
Generate test fixtures, mock data, and example configurations for AgentScope 2.0 agents and pipelines. Use this when the user needs to test AgentScope code, create unit test data, or generate example agent configurations for development and CI.
version
0.1.0
metadata
{"openclaw":{"requires":{"env":["OPENAI_API_KEY"],"bins":["python3"]},"primaryEnv":"OPENAI_API_KEY","envVars":[{"name":"OPENAI_API_KEY","required":false,"description":"Optional API key for validating generated configs against a real provider."},{"name":"AGENTSCOPE_MODEL","required":false,"description":"Optional default model name used in generated example configs."}],"emoji":"🧪","homepage":"https://github.com/agentscope-ai/agentscope"}}

AgentScope Test Fixture Generator

This skill generates ready-to-use test fixtures for AgentScope 2.0 projects. It helps developers quickly create mock data, example configurations, and test scaffolding for unit tests, integration tests, and documentation examples.

What this skill does

  • Generates mock agent configurations with various model providers
  • Creates test fixture files for common AgentScope patterns
  • Produces example pipeline configurations
  • Generates mock response data for testing
  • Creates pytest-compatible test scaffolding

How to use

Run the generator script from this skill folder:

python3 scripts/generate_fixtures.py --output /path/to/test/fixtures --pattern sequential

Supported patterns:

  • sequential - single agent chain fixtures
  • parallel - multi-agent parallel execution fixtures
  • team - team-based agent fixtures
  • dialogue - multi-turn conversation fixtures

After generation:

cd /path/to/test/fixtures
pytest

Security notes

  • Generated fixtures use placeholder API keys and mock responses
  • No real credentials are embedded in generated files
  • All generated configs are safe for CI environments

Troubleshooting

  • If import fails, ensure agentscope is installed: pip install agentscope
  • For model-specific fixtures, set the appropriate environment variable
  • Generated tests require pytest: pip install pytest