This commit is contained in:
Mateusz Gruszczyński
2026-09-04 08:59:11 +02:00
parent 39f50eba2e
commit 7fd5921ba9
17 changed files with 276 additions and 1268 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Developer smoke/integration tests for GREE Controller API 0.12.0.
"""Developer smoke/integration tests for GREE Controller API 0.12.1.
Default mode is read-only and safe to run against a real controller.
Use --settings-write to additionally round-trip all split settings resources and
@@ -26,7 +26,7 @@ from typing import Any, Callable, Iterable, Optional
DEFAULT_BASE_URL = os.environ.get("GREE_API_URL", "http://127.0.0.1:8787")
DEFAULT_TOKEN = os.environ.get("GREE_API_TOKEN", "")
DEFAULT_EXPECTED_VERSION = "0.12.0"
DEFAULT_EXPECTED_VERSION = "0.12.1"
SETTINGS_PATHS: dict[str, set[str]] = {
"/api/settings/application": {"simulator_enabled"},
@@ -331,7 +331,7 @@ def test_openapi(client: ApiClient, expected_version: str) -> str:
raise TestFailure("OpenAPI has no paths object")
missing = sorted(EXPECTED_OPENAPI_PATHS - set(paths))
if missing:
raise TestFailure(f"OpenAPI missing 0.12.0 paths: {missing}")
raise TestFailure(f"OpenAPI missing required paths: {missing}")
forbidden = sorted(set(REMOVED_0120_PATHS) & set(paths))
if forbidden:
raise TestFailure(f"OpenAPI still exposes removed paths: {forbidden}")
@@ -503,7 +503,7 @@ def run_suite(args: argparse.Namespace) -> int:
print(f"Settings write tests: {'ENABLED' if args.settings_write else 'disabled'}\n")
runner.run("public health", lambda: test_health(client, args.expected_version))
runner.run("OpenAPI 0.12.0 contract", lambda: test_openapi(client, args.expected_version))
runner.run("OpenAPI 0.12.1 contract", lambda: test_openapi(client, args.expected_version))
runner.run("protected API requires auth", lambda: test_protected_auth(client))
for path in SAFE_GET_PATHS:
@@ -571,7 +571,7 @@ def run_suite(args: argparse.Namespace) -> int:
def parse_args(argv: Optional[Iterable[str]] = None) -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Developer smoke/integration tests for GREE Controller API 0.12.0.",
description="Developer smoke/integration tests for GREE Controller API 0.12.1.",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""Examples:
python3 scripts/api_dev_test.py