mirror of
https://github.com/santinic/audiblez.git
synced 2025-08-05 16:48:55 +00:00
tests
This commit is contained in:
parent
5a388196b8
commit
6cb90f9b1a
1 changed files with 28 additions and 0 deletions
28
test/test_main.py
Normal file
28
test/test_main.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
import unittest
|
||||
from pathlib import Path
|
||||
from kokoro_onnx import Kokoro
|
||||
|
||||
from audiblez import VOICES_FILE, MODEL_FILE, main
|
||||
|
||||
|
||||
class MainTest(unittest.TestCase):
|
||||
def base(self, **kwargs):
|
||||
base_path = Path(__file__).parent / '..'
|
||||
kokoro = Kokoro(base_path / MODEL_FILE, base_path / VOICES_FILE)
|
||||
main(kokoro, lang='en-gb', voice='af_sky', providers=None, pick_manually=False, speed=1, **kwargs)
|
||||
|
||||
def test_1_mini(self):
|
||||
Path('mini.m4b').unlink(missing_ok=True)
|
||||
self.base(file_path='../epub/mini.epub')
|
||||
self.assertTrue(Path('mini.m4b').exists())
|
||||
|
||||
def test_2_allan_poe(self):
|
||||
Path('poe.m4b').unlink(missing_ok=True)
|
||||
self.base(file_path='../epub/poe.epub')
|
||||
self.assertTrue(Path('poe.m4b').exists())
|
||||
|
||||
def test_3_great_gatsby_two_chapters(self):
|
||||
Path('gene.m4b').unlink(missing_ok=True)
|
||||
self.base(file_path='../epub/gene.epub')
|
||||
self.assertTrue(Path('gene.m4b').exists())
|
||||
|
Loading…
Add table
Reference in a new issue