Skip to content

Commit

Permalink
整理: 使用されていない TTSEngineManager.has_engine() を削除 (#1446)
Browse files Browse the repository at this point in the history
refactor: 使用されていない ``TTSEngineManager.has_engine()` を削除
  • Loading branch information
tarepan authored Jun 28, 2024
1 parent 000b363 commit 2974aab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
30 changes: 0 additions & 30 deletions test/unit/tts_pipeline/test_tts_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions voicevox_engine/tts_pipeline/tts_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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エンジン一覧を生成する"""
Expand Down

0 comments on commit 2974aab

Please sign in to comment.