diff --git a/test/tts_pipeline/test_mora_to_text.py b/test/tts_pipeline/test_mora_to_text.py deleted file mode 100644 index 8fcc6bd63..000000000 --- a/test/tts_pipeline/test_mora_to_text.py +++ /dev/null @@ -1,28 +0,0 @@ -from unittest import TestCase - -from voicevox_engine.tts_pipeline.text_analyzer import mora_to_text - - -class TestMoraToText(TestCase): - def test_voice(self): - self.assertEqual(mora_to_text("a"), "ア") - self.assertEqual(mora_to_text("i"), "イ") - self.assertEqual(mora_to_text("ka"), "カ") - self.assertEqual(mora_to_text("N"), "ン") - self.assertEqual(mora_to_text("cl"), "ッ") - self.assertEqual(mora_to_text("gye"), "ギェ") - self.assertEqual(mora_to_text("ye"), "イェ") - self.assertEqual(mora_to_text("wo"), "ウォ") - - def test_unvoice(self): - self.assertEqual(mora_to_text("A"), "ア") - self.assertEqual(mora_to_text("I"), "イ") - self.assertEqual(mora_to_text("kA"), "カ") - self.assertEqual(mora_to_text("gyE"), "ギェ") - self.assertEqual(mora_to_text("yE"), "イェ") - self.assertEqual(mora_to_text("wO"), "ウォ") - - def test_invalid_mora(self): - """変なモーラが来ても例外を投げない""" - self.assertEqual(mora_to_text("x"), "x") - self.assertEqual(mora_to_text(""), "") diff --git a/test/tts_pipeline/test_text_analyzer.py b/test/tts_pipeline/test_text_analyzer.py index 2e3bb376a..ebaf30977 100644 --- a/test/tts_pipeline/test_text_analyzer.py +++ b/test/tts_pipeline/test_text_analyzer.py @@ -7,6 +7,7 @@ Label, MoraLabel, UtteranceLabel, + mora_to_text, text_to_accent_phrases, ) @@ -320,6 +321,31 @@ def test_features(self): self.assertEqual(features(self.utterance_hello_hiho), self.test_case_hello_hiho) +class TestMoraToText(TestCase): + def test_voice(self): + self.assertEqual(mora_to_text("a"), "ア") + self.assertEqual(mora_to_text("i"), "イ") + self.assertEqual(mora_to_text("ka"), "カ") + self.assertEqual(mora_to_text("N"), "ン") + self.assertEqual(mora_to_text("cl"), "ッ") + self.assertEqual(mora_to_text("gye"), "ギェ") + self.assertEqual(mora_to_text("ye"), "イェ") + self.assertEqual(mora_to_text("wo"), "ウォ") + + def test_unvoice(self): + self.assertEqual(mora_to_text("A"), "ア") + self.assertEqual(mora_to_text("I"), "イ") + self.assertEqual(mora_to_text("kA"), "カ") + self.assertEqual(mora_to_text("gyE"), "ギェ") + self.assertEqual(mora_to_text("yE"), "イェ") + self.assertEqual(mora_to_text("wO"), "ウォ") + + def test_invalid_mora(self): + """変なモーラが来ても例外を投げない""" + self.assertEqual(mora_to_text("x"), "x") + self.assertEqual(mora_to_text(""), "") + + def _gen_mora(text: str, consonant: str | None, vowel: str) -> Mora: return Mora( text=text,