·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