From 77f9b7428698a0764ceb3588ddf115b0902769f2 Mon Sep 17 00:00:00 2001 From: architect-bot Date: Wed, 19 Aug 2026 14:12:56 +0000 Subject: [PATCH] WIP checkpoint: Architecture: ApiClient autoload (HTTP + JWT + error contract) --- scripts/smoke_test_api.gd | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/smoke_test_api.gd diff --git a/scripts/smoke_test_api.gd b/scripts/smoke_test_api.gd new file mode 100644 index 0000000..1886817 --- /dev/null +++ b/scripts/smoke_test_api.gd @@ -0,0 +1,31 @@ +extends SceneTree +## Headless smoke test for the ApiClient autoload. +## +## Run with: +## godot --headless --path . --script res://scripts/smoke_test_api.gd +## +## Requires the backend to be running (default base URL +## `application/agp/api_base_url` -> http://127.0.0.1:8000). +## +## Calls the real autoload's `health_check()` (which exercises the generic +## `request()` primitive) and exits 0 on a `status == "ok"` response, 1 +## otherwise. This script is intentionally NOT wired into any game scene. + + +func _initialize() -> void: + _run() + + +func _run() -> void: + print("SMOKE: calling ApiClient.health_check() ...") + var result: Dictionary = await ApiClient.health_check() + print("SMOKE: result = ", result) + + if result.ok \ + and result.data is Dictionary \ + and str((result.data as Dictionary).get("status", "")) == "ok": + print("SMOKE RESULT: PASS (status=ok)") + quit(0) + else: + printerr("SMOKE RESULT: FAIL") + quit(1)