TTS/tests/test_preprocessors.py

18 lines
804 B
Python
Raw Normal View History

import os
2021-04-12 09:47:39 +00:00
import unittest
2021-04-12 09:47:39 +00:00
from tests import get_tests_input_path
2020-09-09 10:27:23 +00:00
from TTS.tts.datasets.preprocess import common_voice
class TestPreprocessors(unittest.TestCase):
2021-04-12 09:47:39 +00:00
def test_common_voice_preprocessor(self): # pylint: disable=no-self-use
root_path = get_tests_input_path()
meta_file = "common_voice.tsv"
items = common_voice(root_path, meta_file)
2021-04-12 09:47:39 +00:00
assert items[0][0] == "The applicants are invited for coffee and visa is given immediately."
assert items[0][1] == os.path.join(get_tests_input_path(), "clips", "common_voice_en_20005954.wav")
assert items[-1][0] == "Competition for limited resources has also resulted in some local conflicts."
assert items[-1][1] == os.path.join(get_tests_input_path(), "clips", "common_voice_en_19737074.wav")