Skip to content

Commit

Permalink
修正: テストの副産物 invalid.vvlib を削除 (#1370)
Browse files Browse the repository at this point in the history
* fix: テストの副産物 `invalid.vvlib` を削除

* fix: lint
  • Loading branch information
tarepan authored Jun 2, 2024
1 parent 4e8c905 commit 19f4526
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_library_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy
import glob
import json
import os
from io import BytesIO
from pathlib import Path
from tempfile import TemporaryDirectory
Expand Down Expand Up @@ -102,6 +103,8 @@ def test_install_manifest_less_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} にvvlib_manifest.jsonが存在しません。",
)
# TODO: tmp ファイルを用いた自動削除、あるいは、共通 teardown による削除へ実装し直す
os.remove(invalid_vvlib_name)

def test_install_broken_manifest_library(self) -> None:
"""不正な形式の vvlib_manifest.json をもつ ZIP ファイルは音声ライブラリとしてインストールできない。"""
Expand All @@ -119,6 +122,7 @@ def test_install_broken_manifest_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} のvvlib_manifest.jsonは不正です。",
)
os.remove(invalid_vvlib_name)

def test_install_invalid_type_manifest_library(self) -> None:
"""不正な形式の vvlib_manifest.json をもつ ZIP ファイルは音声ライブラリとしてインストールできない。"""
Expand All @@ -135,6 +139,7 @@ def test_install_invalid_type_manifest_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} のvvlib_manifest.jsonが不正な形式です。",
)
os.remove(invalid_vvlib_name)

def test_install_invalid_version_manifest_library(self) -> None:
# vvlib_manifestの不正なversionのテスト
Expand All @@ -150,6 +155,7 @@ def test_install_invalid_version_manifest_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} のversion形式が不正です。",
)
os.remove(invalid_vvlib_name)

def test_install_invalid_manifest_version_library(self) -> None:
# vvlib_manifestの不正なmanifest_versionのテスト
Expand All @@ -165,6 +171,7 @@ def test_install_invalid_manifest_version_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} のmanifest_version形式が不正です。",
)
os.remove(invalid_vvlib_name)

def test_install_invalid_manifest_version_library_2(self) -> None:
# vvlib_manifestの未対応のmanifest_versionのテスト
Expand All @@ -182,6 +189,7 @@ def test_install_invalid_manifest_version_library_2(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid} は未対応です。",
)
os.remove(invalid_vvlib_name)

def test_install_non_target_engine_library(self) -> None:
# vvlib_manifestのインストール先エンジンの検証のテスト
Expand All @@ -199,6 +207,7 @@ def test_install_non_target_engine_library(self) -> None:
e.exception.detail,
f"音声ライブラリ {self.library_uuid}{self.engine_name}向けではありません。",
)
os.remove(invalid_vvlib_name)

def test_install(self) -> None:
# 正しいライブラリをインストールして問題が起きないか
Expand Down

0 comments on commit 19f4526

Please sign in to comment.