- Replace 153 broad `except Exception` with specific types (SQLAlchemyError, TemplateError, OSError, SMTPException, ClientError, etc.) across 37 services - Break catalog↔inventory circular dependency (IMPORT-004) - Create 19 skeleton test files for MOD-024 coverage - Exclude aggregator services from MOD-024 (false positives) - Update test mocks to match narrowed exception types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
658 B
Python
24 lines
658 B
Python
"""Unit tests for theme_presets."""
|
|
|
|
import pytest
|
|
|
|
from app.modules.cms.services.theme_presets import get_available_presets, get_preset
|
|
|
|
|
|
@pytest.mark.unit
|
|
@pytest.mark.cms
|
|
class TestThemePresets:
|
|
"""Test suite for theme preset functions."""
|
|
|
|
def test_get_available_presets(self):
|
|
"""Available presets returns a list."""
|
|
presets = get_available_presets()
|
|
assert isinstance(presets, list)
|
|
|
|
def test_get_preset_default(self):
|
|
"""Default preset can be retrieved."""
|
|
presets = get_available_presets()
|
|
if presets:
|
|
preset = get_preset(presets[0])
|
|
assert isinstance(preset, dict)
|