-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* e2eテストのsessionをfixtureにする * デグレってた * isort * default_setting.ymlに変更 * テストの実行方法をREADMEに追記
- Loading branch information
Showing
4 changed files
with
32 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
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 | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def client(): | ||
synthesis_engines = make_synthesis_engines(use_gpu=False) | ||
latest_core_version = get_latest_core_version(versions=synthesis_engines.keys()) | ||
setting_loader = SettingLoader(Path("./default_setting.yml")) | ||
|
||
return TestClient( | ||
generate_app( | ||
synthesis_engines=synthesis_engines, | ||
latest_core_version=latest_core_version, | ||
setting_loader=setting_loader, | ||
) | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from generate_test_client import client | ||
from fastapi.testclient import TestClient | ||
|
||
from voicevox_engine import __version__ | ||
|
||
|
||
def test_fetch_version_success(): | ||
def test_fetch_version_success(client: TestClient): | ||
response = client.get("/version") | ||
assert response.status_code == 200 | ||
assert response.json() == __version__ |