mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
refactor: centralize integration config in domain layer, fix OutputFormat enum serialization
- Move stored_integration_config(), build_audiobookshelf_config() to domain/settings_core.py
- Remove legacy fallback from stored_integration_config() (only config[integrations])
- Add load_audiobookshelf_config() as combined entry point
- PostConversionHooks reads config directly via stored_integration_config()
- WebUI imports from domain/settings_core instead of webui/routes/utils/settings
- Remove duplicate _build_abs_config() from PostConversionHooks
- Remove dead audiobookshelf code from infrastructure/exporters.py
- Remove duplicate audiobookshelf functions from webui/service.py
- Fix OutputFormat enum serialization in output_layout_service.py and conversion_executor.py
(f'{enum}' gave 'OutputFormat.WAV' instead of '.wav')
- Mock spaCy in test_returns_at_least_one_segment instead of loading real model
- Add 28 tests for PostConversionHooks and build_audiobookshelf_config
This commit is contained in:
@@ -251,13 +251,15 @@ class TestSpacyPreTtsSegmentation:
|
||||
assert len(segments) == 1
|
||||
|
||||
def test_returns_at_least_one_segment(self):
|
||||
from unittest.mock import patch
|
||||
from abogen.domain.conversion_pipeline import spacy_pre_tts_segmentation
|
||||
from abogen.domain.enums import Language
|
||||
|
||||
segments, split = spacy_pre_tts_segmentation(
|
||||
"",
|
||||
Language.FR,
|
||||
"Sentence",
|
||||
use_spacy_segmentation=True,
|
||||
)
|
||||
with patch("abogen.spacy_utils.segment_sentences", return_value=None):
|
||||
segments, split = spacy_pre_tts_segmentation(
|
||||
"",
|
||||
Language.FR,
|
||||
"Sentence",
|
||||
use_spacy_segmentation=True,
|
||||
)
|
||||
assert len(segments) >= 1
|
||||
|
||||
Reference in New Issue
Block a user