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)
- Domain tests: no mocks, assert invariants and state transitions.
- UseCase tests: mock repository interfaces (
Mock(spec=...)), assert:- correct repository method calls
- correct domain exceptions raised
- correct entity state transitions
- Infrastructure/Presentation: add integration tests separately (optional).