feat(tests): increase test coverage from 68% to 78%
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline failed

Add comprehensive integration and API tests:
- Integration tests for SQLAlchemyPostRepository (34 tests)
- API tests for posts endpoints and error handlers (22 tests)
- Unit tests for PublishPostUseCase and ListPostsUseCase
- Unit tests for SessionTransactionManager

Also register generic exception handler in error_handler.py

All 167 tests pass, coverage now meets CI threshold of 70%
This commit is contained in:
2026-05-02 18:40:29 +03:00
parent 41b6698c55
commit ce2c052684
7 changed files with 1450 additions and 0 deletions

View File

@@ -129,3 +129,4 @@ def register_exception_handlers(app: FastAPI) -> None:
app.add_exception_handler(DomainException, domain_exception_handler) # type: ignore[arg-type]
app.add_exception_handler(StarletteHTTPException, http_exception_handler) # type: ignore[arg-type]
app.add_exception_handler(Exception, generic_exception_handler)