Verify voice export quality guard and record final file checks
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import copy
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -113,6 +112,17 @@ class VoiceHistoryTests(unittest.TestCase):
|
||||
self.assertEqual(changed, (target / 'count_01.wav').read_bytes())
|
||||
self.assertNotEqual(original, changed)
|
||||
|
||||
def test_long_count_is_blocked_before_export(self):
|
||||
import sys
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
from prepare_voice import prepare
|
||||
def long_take(clip): return np.ones(72000, dtype=np.float32) * .1, 24000
|
||||
manifest = voice.generate(self.catalog, self.profile, self.root, synthesize=long_take)
|
||||
target = self.root / 'runtime'
|
||||
with self.assertRaisesRegex(ValueError, 'exceeds 2 seconds'):
|
||||
prepare(manifest, self.catalog, self.profile, self.root, target)
|
||||
self.assertFalse(target.exists())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user