diff --git a/src-python/docs/details/backend_test.md b/src-python/docs/test_endpoints.md similarity index 98% rename from src-python/docs/details/backend_test.md rename to src-python/docs/test_endpoints.md index 9cd03d81..f63596e4 100644 --- a/src-python/docs/details/backend_test.md +++ b/src-python/docs/test_endpoints.md @@ -1,4 +1,4 @@ -# backend_test.py - APIエンドポイントテストモジュール +# test_endpoints.py - APIエンドポイントテストモジュール ## 概要 VRCTアプリケーションのAPIエンドポイントを包括的にテストするためのモジュールです。メインループの各種機能をランダムアクセスでテストし、システムの安定性と堅牢性を検証します。 diff --git a/src-python/test_client.py b/src-python/test_client.py index 6dd565d2..ef34f3ff 100644 --- a/src-python/test_client.py +++ b/src-python/test_client.py @@ -540,6 +540,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/plamo_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/plamo_auth_key": data = "PLAMO_DUMMY_KEY" expected = [200,400] @@ -547,6 +548,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/gemini_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/gemini_auth_key": data = "GEMINI_DUMMY_KEY" expected = [200,400] @@ -554,6 +556,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/openai_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/openai_auth_key": data = "OPENAI_DUMMY_KEY" expected = [200,400] @@ -561,6 +564,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/lmstudio_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/lmstudio_url": import random data = random.choice(["http://localhost:1234/v1","http://127.0.0.1:1234/v1","http://invalid_host:9999/v1"]) @@ -569,6 +573,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/ollama_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/deepl_auth_key": data = "DEEPL_DUMMY_KEY" expected=[200,400] @@ -745,7 +750,8 @@ class AutomatedEndpointTester: self._record(endpoint, None, None, expected) print(f"[SetData] {endpoint} -> {Color.RED}UNKNOWN{Color.RESET}") return False - if data is None: + # data が None でも expected に 400 が含まれていれば送信してテスト + if data is None and 400 not in expected: self._record(endpoint, None, None, expected) print(f"[SetData] {endpoint} -> {Color.YELLOW}SKIP(no data){Color.RESET}") return True diff --git a/src-python/backend_test.py b/src-python/test_endpoints.py similarity index 100% rename from src-python/backend_test.py rename to src-python/test_endpoints.py