mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
refactor: remove _prepare_tts_context, use build_tts_context directly
- Deleted _prepare_tts_context() (104 lines of duplicated logic) - Replaced with direct build_tts_context() call in run_conversion() - Fixed _finalize() to use raw fields (generate_epub3, epub3_book_id) - Removed _MockJob antipattern - Updated tests to use raw normalization_overrides field - ConversionRequest uses raw fields instead of PronunciationConfig/Epub3ExportConfig
This commit is contained in:
@@ -250,16 +250,12 @@ class TestConversionService:
|
||||
from abogen.application.conversion_service import run_conversion
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
from abogen.application.conversion_config import PronunciationConfig
|
||||
|
||||
req = ConversionRequest(
|
||||
direct_text="Hello",
|
||||
voice="M1",
|
||||
save_mode="custom_folder",
|
||||
output_folder=Path(tmpdir),
|
||||
pronunciation=PronunciationConfig(
|
||||
normalization_overrides={"normalization_numbers": False},
|
||||
),
|
||||
normalization_overrides={"normalization_numbers": False},
|
||||
)
|
||||
events = FakeEvents()
|
||||
pipeline = FakePipelineProvider()
|
||||
@@ -273,16 +269,12 @@ class TestConversionService:
|
||||
from abogen.application.conversion_service import run_conversion
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
from abogen.application.conversion_config import PronunciationConfig
|
||||
|
||||
req = ConversionRequest(
|
||||
direct_text="Hello",
|
||||
voice="M1",
|
||||
save_mode="custom_folder",
|
||||
output_folder=Path(tmpdir),
|
||||
pronunciation=PronunciationConfig(
|
||||
normalization_overrides={"normalization_apostrophe_mode": "llm"},
|
||||
),
|
||||
normalization_overrides={"normalization_apostrophe_mode": "llm"},
|
||||
)
|
||||
events = FakeEvents()
|
||||
pipeline = FakePipelineProvider()
|
||||
|
||||
Reference in New Issue
Block a user