Skip to content

Commit

Permalink
追加: 音量更新API関連テストの追加 (#1199)
Browse files Browse the repository at this point in the history
* 音量更新API関連テストの追加

* 変数名は単純にできた

* NOTE: 入力生成の簡略化に別関数を呼び出すため、別関数が正しく動作しない場合テストが落ちる
  • Loading branch information
Hiroshiba authored Apr 30, 2024
1 parent 0442219 commit 15a2c6a
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions test/tts_pipeline/test_tts_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,27 @@ def test_mocked_synthesize_wave_output(snapshot_json: SnapshotAssertion) -> None
assert snapshot_json == round_floats(result.tolist(), round_value=2)


def test_mocked_create_sing_volume_from_phoneme_and_f0_output(
snapshot_json: SnapshotAssertion,
) -> None:
"""
モックされた `TTSEngine.create_sing_phoneme_and_f0_and_volume()` の出力スナップショットが一定である
NOTE: 入力生成の簡略化に別関数を呼び出すため、別関数が正しく動作しない場合テストが落ちる
"""
# Inputs
tts_engine = TTSEngine(MockCoreWrapper())
doremi_srore = _gen_doremi_score()
phonemes, f0s, _ = tts_engine.create_sing_phoneme_and_f0_and_volume(
doremi_srore, StyleId(1)
)
# Outputs
result = tts_engine.create_sing_volume_from_phoneme_and_f0(
doremi_srore, phonemes, f0s, StyleId(1)
)
# Tests
assert snapshot_json == round_floats(result, round_value=2)


def test_mocked_synthesize_wave_from_score_output(
snapshot_json: SnapshotAssertion,
) -> None:
Expand Down

0 comments on commit 15a2c6a

Please sign in to comment.