Skip to content

Commit

Permalink
versionを取得するe2eテストを書く (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
stmtk1 authored Aug 26, 2023
1 parent 416d905 commit 15c47d6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/generate_test_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from fastapi.testclient import TestClient
from run import generate_app

from voicevox_engine.setting import SettingLoader
from voicevox_engine.synthesis_engine import make_synthesis_engines
from voicevox_engine.utility.core_version_utility import get_latest_core_version

synthesis_engines = make_synthesis_engines(use_gpu=False)
latest_core_version = get_latest_core_version(versions=synthesis_engines.keys())
setting_loader = SettingLoader("./e2e_test_setting.yml")

client = TestClient(
generate_app(
synthesis_engines=synthesis_engines,
latest_core_version=latest_core_version,
setting_loader=setting_loader,
)
)
9 changes: 9 additions & 0 deletions test/e2e/test_validate_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from generate_test_client import client

from voicevox_engine import __version__


def test_fetch_version_success():
response = client.get("/version")
assert response.status_code == 200
assert response.json() == __version__

0 comments on commit 15c47d6

Please sign in to comment.