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.
git clone --depth 1 https://github.com/eliornl/rolemuleWrote 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.
[](https://agentmods.dev/rules/eliornl/rolemule/unit-testing)<a href="https://agentmods.dev/rules/eliornl/rolemule/unit-testing"><img src="https://agentmods.dev/badge/rules/eliornl/rolemule/unit-testing/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.
<a href="https://agentmods.dev/rules/eliornl/rolemule/unit-testing"><img src="https://agentmods.dev/badge/rules/eliornl/rolemule/unit-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02389 |
| Opus 5.5 | $0.00000 | $0.00956 |
| Sonnet 5.5 | $0.00000 | $0.00478 |
| Haiku 4.5 | $0.00000 | $0.00239 |
Grade A, and why
unit-testing 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Testing
Approximate counts (CI suites): ~300 agent unit tests in tests/test_agents/, ~1,050 API integration tests in tests/test_api/, 364 mocked CLI tests in tests/test_cli/, 6 ASGI CLI integration tests in tests/test_cli_integration/ (run with --override-ini="addopts=").
Test Suites
CLI Tests (tests/test_cli/)
Typer CliRunner + mocked RoleMuleClient — no running server required.
make cli-test
# or:
pip install -e ".[cli]" && pytest tests/test_cli/ -v --override-ini="addopts="
CLI ASGI Integration (tests/test_cli_integration/)
Real FastAPI app + Postgres (same stack as test_api/). Run locally with DATABASE_URL set, or in CI python-tests job.
Event loop: patch_httpx_asgi in tests/test_cli_integration/conftest.py must route sync httpx.Client through httpx.ASGITransport + AsyncClient on the pytest-asyncio session loop. Do not use Starlette TestClient — after tests/test_api has run, TestClient’s private loop causes “Event loop is closed” / “Future attached to a different loop” and auth failures (AUTH_1003).
pytest tests/test_cli_integration/ -v --override-ini="addopts="
Unit Tests (tests/test_agents/)
Pure pytest, fully mocked LLM clients, no network required.
pytest tests/test_agents/ -v
pytest tests/test_agents/test_cv_optimizer_loop.py -v # CV optimizer orchestrator + agents
pytest tests/test_agents/test_mock_interview.py -v # practice interview agent
pytest tests/test_agents/test_hiring_outreach.py -v # hiring outreach agent
API Integration Tests (tests/test_api/)
Uses ASGITransport (no running server). Real test DB, mocked rate limits + LLM agents.
# Strip the coverage addopts that require the pytest-cov plugin:
pytest tests/test_api/ -v --override-ini="addopts="
pytest tests/test_api/test_auth.py -v # auth endpoints
pytest tests/test_api/test_career_tools.py -v # 6 career tools
pytest tests/test_api/test_extension_autofill.py -v # extension POST /extension/autofill/map
pytest tests/test_api/test_interview_prep.py # interview prep
pytest tests/test_api/test_mock_interview.py # practice / mock interview
pytest tests/test_api/test_hiring_outreach.py # hiring outreach
pytest tests/test_api/test_cv_optimizer.py # CV optimizer (ownership-before-cache, cache unwrap)
pytest tests/test_api/test_workflow.py # workflow trigger/status; duplicate start → RES_3002 (409); duplicate start → RES_3002 (409)
pytest tests/test_api/test_profile.py # profile/settings
pytest tests/test_api/test_applications.py # applications list (search/sort/filter/pagination)
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.
- 1mo ago First seen · 223 lines · 0 tokens per session scan A 1c1dadba848d
unit-testing is a cursor rule published in the GitHub repository eliornl/rolemule (38 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,389 tokens. 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-08-30.
Other cursor rules, from other repositories
test-guide
Cursor rule "test-guide" from first-fluke/fullstack-starter, covering test guide, quick commands, run all tests, all tests and or individually.
debug
Bug diagnosis and fixing standards - root cause analysis, minimal fixes, regression tests.
verify-scope
A guide for choosing how much testing to run after a code change, from one named test to the full release check. It covers pytest, Vitest, browser screenshots, type checks, linting, and the release gate.
unit-test-coverage-95
Unit test coverage ≥95% per Go package (binding rule).
testing-and-security
Testing and Security Guidelines for FastAPI Applications Including Unit Testing, Environment Variable Management, and Authentication Security.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.