python-fastapi-ddd-testing-skill

Installation
SKILL.md

Testing DDD Layers with pytest (Domain / UseCase)

This skill focuses on unit tests for the inner layers:

  • Domain: Value Objects + Entities (pure business rules)
  • UseCase: application workflows that orchestrate Domain + Repository interfaces

It intentionally avoids full HTTP/API tests unless explicitly requested.

Test strategy (recommended)

  1. Domain tests: no mocks, assert invariants and state transitions.
  2. UseCase tests: mock repository interfaces (Mock(spec=...)), assert:
    • correct repository method calls
    • correct domain exceptions raised
    • correct entity state transitions
  3. Infrastructure/Presentation: add integration tests separately (optional).

Folder structure

Related skills
Installs
17
GitHub Stars
2
First Seen
Feb 13, 2026