oamg/leapp-repository/leapp-unit-tests
Claude Code and agent skill by oamg/leapp-repository
- community
Checking that the SKILL.md file is still in the repository.
Write or fix unit tests for leapp-repository actors and shared libraries. Covers test placement, mocking patterns, and project conventions.
Install
npx vskill@latest install oamg/leapp-repository/leapp-unit-testsSKILL.md
Writing Unit Tests
File placement
Tests for actors
Tests live in the tests directory under an actor:
Tests for shared libraries
Tests for shared libraries are in the tests sub-directory next to the shared library, like:
Key testing utilities
As mocked objects, use functions and classes present in leapp.libraries.common.testutils - especially:
| Utility | Purpose | |
|---|---|---|
CurrentActorMocked(...) | Mock api.current_actor with configuration, version, etc. | |
produce_mocked() | Capture api.produce(...) calls for assertions | |
create_report_mocked() | Capture reporting.create_report(...) calls | |
logger_mocked() | Capture log output |
Standard test pattern
Test the library, not the actor class directly:
Rules
- Test the library, not
actor.py— theprocess()method should be a thin wrapper. - Pass consumed messages via
CurrentActorMocked(msgs=[...]). - Mock file I/O instead of creating temp files when possible. Use the
leapp_tmpdirfixture when tempfiles are needed. - Use
monkeypatch.setattroverunittest.mock.patch— monkeypatch is the project convention. - Cover at least: happy path, edge/error cases, and inhibitor conditions if applicable.
- If you intentionally skip a test scenario, add a comment explaining why.
- Use consistent string quoting within a file.
- Use pytest.mark.parametrize where possible.
- Never use type() when creating mock classes.
- Use module-level constants with "_" prefix.
- Name test functions clearly after the behavior:
test_inhibits_when_fips_enablednottest_fips_1. - Look at existing tests in
repos/system_upgrade/common/actors/for project conventions before writing new ones.
Running tests
See skills/leapp-test-runner/ for full commands. Quick single-actor run:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/leapp-unit-tests/SKILL.md
Popularity
- Repository stars
- 63
- Repository forks
- 170
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/oamg/leapp-repository/leapp-unit-tests)