·test-implement-constructor-validation
</>

test-implement-constructor-validation

从服务类签名自动生成构造函数验证测试。 在为新服务创建测试、验证快速失败原则时使用 确保构造函数验证或测试所需参数。分析 服务 __init__ 方法并生成 pytest.raises(ValueError) 测试 对于每个必需的参数。适用于以下 Python 服务类 依赖注入模式。高自动化机会(100+ 测试类 使用此模式)。

4安装·0热度·@dawiddutoit

安装

$npx skills add https://github.com/dawiddutoit/custom-claude --skill test-implement-constructor-validation

如何安装 test-implement-constructor-validation

通过命令行快速安装 test-implement-constructor-validation AI 技能到你的开发环境

  1. 打开终端: 打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 运行安装命令: 复制并运行以下命令:npx skills add https://github.com/dawiddutoit/custom-claude --skill test-implement-constructor-validation
  3. 验证安装: 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

来源:dawiddutoit/custom-claude。

SKILL.md

查看原文

Automatically generate comprehensive constructor validation tests for service classes that follow the fail-fast principle. This skill ensures every required parameter has a corresponding test that validates the service raises ValueError when that parameter is None.

Fixture Exclusion Pattern: Each validation test excludes the fixture for the parameter being tested:

For a complex service with 5 parameters, follow the same pattern as Example 1 above. Create a test class with fixtures for each parameter, a success case test, and one validation failure test for each required parameter. See references/reference.md for detailed pattern analysis and edge cases.

从服务类签名自动生成构造函数验证测试。 在为新服务创建测试、验证快速失败原则时使用 确保构造函数验证或测试所需参数。分析 服务 __init__ 方法并生成 pytest.raises(ValueError) 测试 对于每个必需的参数。适用于以下 Python 服务类 依赖注入模式。高自动化机会(100+ 测试类 使用此模式)。 来源:dawiddutoit/custom-claude。

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/dawiddutoit/custom-claude --skill test-implement-constructor-validation
分类
</>开发工具
认证
收录时间
2026-02-25
更新时间
2026-03-11

Browse more skills from dawiddutoit/custom-claude

快速解答

什么是 test-implement-constructor-validation?

从服务类签名自动生成构造函数验证测试。 在为新服务创建测试、验证快速失败原则时使用 确保构造函数验证或测试所需参数。分析 服务 __init__ 方法并生成 pytest.raises(ValueError) 测试 对于每个必需的参数。适用于以下 Python 服务类 依赖注入模式。高自动化机会(100+ 测试类 使用此模式)。 来源:dawiddutoit/custom-claude。

如何安装 test-implement-constructor-validation?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/dawiddutoit/custom-claude --skill test-implement-constructor-validation 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

这个 Skill 的源码在哪?

https://github.com/dawiddutoit/custom-claude