From 15c47d68f0c705468676dbf635f5de86706909df Mon Sep 17 00:00:00 2001 From: Motoki saito Date: Sat, 26 Aug 2023 11:56:21 +0900 Subject: [PATCH] =?UTF-8?q?version=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99?= =?UTF-8?q?=E3=82=8Be2e=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E6=9B=B8?= =?UTF-8?q?=E3=81=8F=20(#732)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/e2e/generate_test_client.py | 18 ++++++++++++++++++ test/e2e/test_validate_version.py | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/e2e/generate_test_client.py create mode 100644 test/e2e/test_validate_version.py diff --git a/test/e2e/generate_test_client.py b/test/e2e/generate_test_client.py new file mode 100644 index 000000000..c5a8e29ed --- /dev/null +++ b/test/e2e/generate_test_client.py @@ -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, + ) +) diff --git a/test/e2e/test_validate_version.py b/test/e2e/test_validate_version.py new file mode 100644 index 000000000..f606b192a --- /dev/null +++ b/test/e2e/test_validate_version.py @@ -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__