From 2974aabea2a0e9eada303ba94c195739bd36d80b Mon Sep 17 00:00:00 2001 From: tarepan Date: Fri, 28 Jun 2024 15:06:09 +0900 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86:=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=20`TTSEn?= =?UTF-8?q?gineManager.has=5Fengine()`=20=E3=82=92=E5=89=8A=E9=99=A4=20(#1?= =?UTF-8?q?446)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 使用されていない ``TTSEngineManager.has_engine()` を削除 --- test/unit/tts_pipeline/test_tts_engines.py | 30 ---------------------- voicevox_engine/tts_pipeline/tts_engine.py | 4 --- 2 files changed, 34 deletions(-) diff --git a/test/unit/tts_pipeline/test_tts_engines.py b/test/unit/tts_pipeline/test_tts_engines.py index c49bf5462..3c82a0fe9 100644 --- a/test/unit/tts_pipeline/test_tts_engines.py +++ b/test/unit/tts_pipeline/test_tts_engines.py @@ -79,33 +79,3 @@ def test_tts_engines_get_engine_missing() -> None: # Test with pytest.raises(HTTPException) as _: tts_engines.get_engine("0.0.3") - - -def test_tts_engines_has_engine_true() -> None: - """TTSEngineManager.has_engine() で TTS エンジンが登録されていることを確認できる。""" - # Inputs - tts_engines = TTSEngineManager() - tts_engines.register_engine(MockTTSEngine(), "0.0.1") - tts_engines.register_engine(MockTTSEngine(), "0.0.2") - # Expects - expected_has = True - # Outputs - has = tts_engines.has_engine("0.0.1") - - # Test - assert expected_has == has - - -def test_tts_engines_has_engine_false() -> None: - """TTSEngineManager.has_engine() で TTS エンジンが登録されていないことを確認できる。""" - # Inputs - tts_engines = TTSEngineManager() - tts_engines.register_engine(MockTTSEngine(), "0.0.1") - tts_engines.register_engine(MockTTSEngine(), "0.0.2") - # Expects - expected_has = False - # Outputs - has = tts_engines.has_engine("0.0.3") - - # Test - assert expected_has == has diff --git a/voicevox_engine/tts_pipeline/tts_engine.py b/voicevox_engine/tts_pipeline/tts_engine.py index 5cde61724..664e11b95 100644 --- a/voicevox_engine/tts_pipeline/tts_engine.py +++ b/voicevox_engine/tts_pipeline/tts_engine.py @@ -730,10 +730,6 @@ def get_engine(self, version: str | LatestVersion) -> TTSEngine: raise HTTPException(status_code=422, detail="不明なバージョンです") - def has_engine(self, version: str) -> bool: - """指定バージョンのエンジンが登録されているか否かを返す。""" - return version in self._engines - def make_tts_engines_from_cores(core_manager: CoreManager) -> TTSEngineManager: """コア一覧からTTSエンジン一覧を生成する"""