"""Tests for domain exceptions.""" from app.domain.exceptions import ( AlreadyExistsException, DomainException, ForbiddenException, NotFoundException, UnauthorizedException, ValidationException, ) class TestDomainExceptions: def test_base_exception(self) -> None: """Test base domain exception.""" exc = DomainException("Something went wrong") assert exc.message == "Something went wrong" assert str(exc) == "Something went wrong" def test_validation_exception(self) -> None: """Test validation exception.""" exc = ValidationException("Invalid input") assert isinstance(exc, DomainException) assert exc.message == "Invalid input" def test_not_found_exception(self) -> None: """Test not found exception.""" exc = NotFoundException("Resource not found") assert isinstance(exc, DomainException) assert exc.message == "Resource not found" def test_already_exists_exception(self) -> None: """Test already exists exception.""" exc = AlreadyExistsException("Already exists") assert isinstance(exc, DomainException) assert exc.message == "Already exists" def test_unauthorized_exception(self) -> None: """Test unauthorized exception.""" exc = UnauthorizedException("Unauthorized") assert isinstance(exc, DomainException) assert exc.message == "Unauthorized" def test_forbidden_exception(self) -> None: """Test forbidden exception.""" exc = ForbiddenException("Forbidden") assert isinstance(exc, DomainException) assert exc.message == "Forbidden"