Verify voice export quality guard and record final file checks

This commit is contained in:
NINI
2026-10-05 01:20:29 +09:00
parent cd32491bbb
commit 1572ddda19
2 changed files with 14 additions and 2 deletions
+11 -1
View File
@@ -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()