diff options
| author | historia <historiavg@proton.me> | 2026-08-17 19:19:40 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-17 19:19:40 -0400 |
| commit | b80fa9db6bab6cdb2856874b606a93149cfc1af2 (patch) | |
| tree | 7404d8f0592ad225cd2074e81f3920d1a498dfe1 /tests/test_converter.py | |
| parent | 0ad594aa6497c4d41272e503f33fde2103b96cd6 (diff) | |
| download | tts-audiobook-generator-b80fa9db6bab6cdb2856874b606a93149cfc1af2.tar.gz | |
feat(converter): add per-chapter and m4b output
Diffstat (limited to 'tests/test_converter.py')
| -rw-r--r-- | tests/test_converter.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_converter.py b/tests/test_converter.py new file mode 100644 index 0000000..1235dda --- /dev/null +++ b/tests/test_converter.py @@ -0,0 +1,21 @@ +"""Tests for the audiobook converter orchestration helpers.""" + +import unittest + +from converter.converter import AudiobookConverter + + +class SanitizeFilenameTests(unittest.TestCase): + def test_removes_invalid_characters(self): + self.assertEqual(AudiobookConverter._sanitize_filename('A "bad" name: here'), + "A bad name here") + + def test_collapses_whitespace(self): + self.assertEqual(AudiobookConverter._sanitize_filename(" spaced\tout "), "spaced out") + + def test_empty_falls_back(self): + self.assertEqual(AudiobookConverter._sanitize_filename("///"), "chapter") + + +if __name__ == "__main__": + unittest.main() |
