aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_audio.py17
-rw-r--r--tests/test_converter.py3
-rw-r--r--tests/test_extractors.py4
-rw-r--r--tests/test_tts.py1
4 files changed, 5 insertions, 20 deletions
diff --git a/tests/test_audio.py b/tests/test_audio.py
index c043766..c127311 100644
--- a/tests/test_audio.py
+++ b/tests/test_audio.py
@@ -175,23 +175,6 @@ class CollectChunkFilesTests(unittest.TestCase):
self.assertEqual(files, [present])
self.assertEqual(missing, [2, 3])
- def test_glob_fallback_without_results(self):
- with tempfile.TemporaryDirectory() as tmp:
- chunks_dir = Path(tmp)
- (chunks_dir / "chunk_0002.wav").write_bytes(b"audio")
- (chunks_dir / "chunk_0001.wav").write_bytes(b"audio")
-
- original = audio.CHUNKS_FOLDER
- audio.CHUNKS_FOLDER = chunks_dir
- try:
- files, missing = _collect_chunk_files(3)
- finally:
- audio.CHUNKS_FOLDER = original
-
- self.assertEqual(files, [chunks_dir / "chunk_0001.wav",
- chunks_dir / "chunk_0002.wav"])
- self.assertEqual(missing, [3])
-
class BuildM4bChaptersCommandTests(unittest.TestCase):
def setUp(self):
diff --git a/tests/test_converter.py b/tests/test_converter.py
index 737fc06..20ebabc 100644
--- a/tests/test_converter.py
+++ b/tests/test_converter.py
@@ -48,13 +48,12 @@ class ConfigurationValidationTests(unittest.TestCase):
def test_language_defaults_to_config(self):
with patch("converter.converter.QwenTTSClient") as mock_tts:
AudiobookConverter()
- self.assertEqual(mock_tts.call_args.kwargs["language"], "English")
+ self.assertEqual(mock_tts.call_args.kwargs["language"], config.LANGUAGE)
def test_output_format_defaults_to_config(self):
with patch("converter.converter.QwenTTSClient"):
converter = AudiobookConverter()
self.assertEqual(converter.output_format, config.AUDIO_FORMAT)
- self.assertEqual(config.AUDIO_FORMAT, "m4b")
def test_language_normalized_before_tts_client(self):
with patch("converter.converter.QwenTTSClient") as mock_tts:
diff --git a/tests/test_extractors.py b/tests/test_extractors.py
index d604351..ae1794c 100644
--- a/tests/test_extractors.py
+++ b/tests/test_extractors.py
@@ -153,6 +153,10 @@ class ExtractBookTests(unittest.TestCase):
self.assertEqual(len(book.sections), 1)
def test_epub_metadata_harvested(self):
+ try:
+ import ebooklib # noqa: F401
+ except ImportError:
+ self.skipTest("ebooklib not installed")
from converter.extractors import extract_book
with tempfile.TemporaryDirectory() as tmp:
diff --git a/tests/test_tts.py b/tests/test_tts.py
index afaa2e3..64b4846 100644
--- a/tests/test_tts.py
+++ b/tests/test_tts.py
@@ -201,7 +201,6 @@ class PayloadLanguageTests(unittest.TestCase):
kwargs = client.clone_client.predict.call_args.kwargs
self.assertEqual(kwargs["model_size"], tts.MODEL_SIZE)
self.assertEqual(kwargs["seed"], config.SEED)
- self.assertNotIn("max_chunk_chars", kwargs)
class FasterTTSClientHealthTests(unittest.TestCase):