mocking-test-generator

mocking-test-generator is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 77 tokens per session (1,386 once invoked), scanned A, original, Apache-2.0.

A unit-test generator for Python and Java code that replaces outside services with controlled stand-ins called mocks. Unit tests check one small piece of code in isolation.

In plain words
What is it for?
It analyzes dependencies, chooses common Python or Java test tools, creates mocks, and writes executable tests with assertions.
Why use it?
It avoids real database calls, network requests, file operations, and other side effects during tests. This makes tests more focused and repeatable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It analyzes dependencies, chooses common Python or Java test tools, creates mocks, and writes executable tests with assertions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arabelatso/skills-4-se/mocking-test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ArabelaTso/Skills-4-SE --skill mocking-test-generator
Clone the repo
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mocking-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/mocking-test-generator/github.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/mocking-test-generator)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/mocking-test-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/mocking-test-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mocking-test-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/mocking-test-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/mocking-test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,386 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.01386
Opus 5 $0.00039 $0.00693
Sonnet 5 $0.00015 $0.00277
Haiku 4.5 $0.00008 $0.00139

Measured 7d ago against content hash 20e4881b6c34, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mocking-test-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mocking-test-generator/SKILL.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mocking Test Generator

Generate unit tests with proper mocking of external dependencies for Python and Java code.

Workflow

  1. Analyze the code - Identify external dependencies, side effects, and testable units
  2. Select framework - Determine Python (unittest.mock/pytest) or Java (Mockito/JUnit)
  3. Generate mocks - Create mock objects for external dependencies
  4. Write tests - Generate executable test code with assertions
  5. Add documentation - Include clear comments explaining mocks and test logic

Step 1: Analyze the Code

Read the target code to identify:

  • External dependencies: API clients, database connections, third-party libraries
  • I/O operations: File reads/writes, network requests, system calls
  • Side effects: Email sending, logging, state modifications
  • Testable units: Functions, methods, or classes to test in isolation

Ask clarifying questions if:

  • Multiple functions/classes exist (which to test?)
  • Testing scope is unclear (unit vs integration?)
  • Mock behavior needs specification (return values, exceptions?)

Step 2: Select Framework

Python: Use unittest.mock with pytest or unittest

  • Prefer @patch decorator for external calls
  • Use Mock() objects for complex dependencies
  • Apply pytest.fixture for reusable mocks

Java: Use Mockito with JUnit 5

  • Use @Mock annotation for dependencies
  • Apply @ExtendWith(MockitoExtension.class) to test class
  • Use when().thenReturn() for stubbing

Step 3: Generate Mocks

Identify what to mock:

Always mock:

  • External API calls (HTTP requests, REST clients)
  • Database connections and queries
  • File system operations
  • Network I/O
  • Time/date functions
  • Random number generators
  • Environment variables

Never mock (unless explicitly requested):

  • Internal business logic
  • Pure functions
  • Data structures
  • Simple utilities

For common patterns, reference:

Read the full file on GitHub · 200 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 200 lines · 77 tokens per session scan A 20e4881b6c34

Subscribe to this mod's changes

mocking-test-generator is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (251 stars, last pushed 20d ago), licensed Apache-2.0. It adds 77 tokens to every session and 1,386 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

review-ugc-render

Mandatory pre-publish review gate for a UGC video render. Transcribes the finished render's AUDIO with Whisper and word-diffs it against the approved spoken script, then gates setfinalrender — blocking a render whose generated audio mis-voices a word (e.g. the approved "human-vetted" spoken as "human witted"), drops…

gooseworks-ai/goose-skills · 116 tokens

test-generator

A test-writing helper that creates unit or integration tests from the code's actual behavior and contracts. Unit tests check small pieces of code, while integration tests check how real components work together.

laolaoshiren/claude-code-skills-zh · 79 tokens

testing-r-packages

Best practices for writing R package tests using testthat version 3+. Use when writing, organizing, or improving tests for R packages. Covers test structure, expectations, fixtures, snapshots, mocking, and modern testthat 3 patterns including self-sufficient tests, proper cleanup with withr, and snapshot testing.

posit-dev/skills · 67 tokens

r-package-development

R package development with devtools, testthat, and roxygen2. Use when the user is working on an R package, running tests, writing documentation, or building package infrastructure.

posit-dev/skills · 41 tokens

111-java-maven-dependencies

Use when you need to add or evaluate Maven dependencies that improve code quality or domain modeling — including nullness annotations (JSpecify), static analysis (Error Prone + NullAway), functional programming (VAVR), architecture testing (ArchUnit), or money and currency support (JavaMoney) — and want a…

jabrena/plinth · 133 tokens

130-java-testing-strategies

Use when you need to apply testing strategies for Java code — RIGHT-BICEP to guide test creation, A-TRIP for test quality characteristics, or CORRECT for verifying boundary conditions. This should trigger for requests such as Review Java code for testing strategies; Apply RIGHT-BICEP testing strategies in Java code…

jabrena/plinth · 96 tokens