This commit is contained in:
Mateusz Gruszczyński
2026-09-18 23:57:28 +02:00
parent 00cbe975bb
commit be3708f14d
17 changed files with 424 additions and 83 deletions
+10 -4
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Developer smoke/integration tests for GREE Controller API 0.15.7.
"""Developer smoke/integration tests for GREE Controller API 0.15.8.
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.15.7"
DEFAULT_EXPECTED_VERSION = "0.15.8"
SETTINGS_PATHS: dict[str, set[str]] = {
"/api/settings/application": {"simulator_enabled"},
@@ -534,7 +534,13 @@ def test_flow_read_subresources(client: ApiClient) -> str:
flow_id = urllib.parse.quote(item["id"], safe="")
export_resp = client.get(f"/api/flows/{flow_id}/export")
assert_status(export_resp, 200)
export_resp.json()
exported = assert_json_object(export_resp)
if exported.get("format") != "gree-controller-flow":
raise AssertionError(f"unexpected Flow export format: {exported.get('format')!r}")
if exported.get("version") != 1:
raise AssertionError(f"unexpected Flow export version: {exported.get('version')!r}")
if "shared_inputs" in exported and not isinstance(exported["shared_inputs"], list):
raise AssertionError("Flow export shared_inputs must be an array")
logs_resp = client.get(f"/api/flows/{flow_id}/logs")
assert_status(logs_resp, 200)
logs_resp.json()
@@ -593,7 +599,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.15.7 contract", lambda: test_openapi(client, args.expected_version))
runner.run("OpenAPI 0.15.8 contract", lambda: test_openapi(client, args.expected_version))
runner.run("bootstrap snapshot contract", lambda: test_bootstrap_contract(client))
runner.run("protected API requires auth", lambda: test_protected_auth(client))