Claude
Cursor
Skill
write-tests
Writes a unit test for one Python function. Use when the user asks for tests of existing code; not for integration tests.
Virus-scanned
Reviewed automatically before listing.
Download
goldziher-ai-rulez-bench_judge_corpus_governance-repo_.claude_skills_write-tests-ca967ad.zip · 0 KB
Install
skills CLI
npx skills add https://github.com/Goldziher/ai-rulez/tree/main/bench/judge/corpus/governance-repo/.claude/skills/write-tests
Claude Code
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git
git clone https://github.com/Goldziher/ai-rulez.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Write tests
- Create the test file named
<module>_test.pynext to the module. - Use this shape:
import unittest
from parcel_calc import total
ITEMS = [10, 20]
class TotalTest(unittest.TestCase):
def test_total(self):
self.assertEqual(total(ITEMS), 30)
def test_total_empty(self):
self.assertEqual(total([]), 0)
if __name__ == "__main__":
unittest.main()
- Run
python <module>_test.pyand confirm that both tests pass.
Files (ai-rulez)
-
SKILL.md 643 B
--- name: write-tests description: "Writes a unit test for one Python function. Use when the user asks for tests of existing code; not for integration tests." --- # Write tests 1. Create the test file named `<module>_test.py` next to the module. 2. Use this shape: ```python import unittest from parcel_calc import total ITEMS = [10, 20] class TotalTest(unittest.TestCase): def test_total(self): self.assertEqual(total(ITEMS), 30) def test_total_empty(self): self.assertEqual(total([]), 0) if __name__ == "__main__": unittest.main() ``` 3. Run `python <module>_test.py` and confirm that both tests pass.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.