feat(client): DmService narrate loop + FakeDmTransport (all branches tested)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 10:04:33 -05:00
parent 32fa372124
commit 513225df3f
6 changed files with 129 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
extends "res://scripts/net/dm_transport.gd"
## Test double for DmTransport. Returns a canned DmResponse and records the last
## call so tests can assert what the service posted. post_json needs no real
## async — awaiting a plain return value resolves immediately, so the same await
## call site in DmService drives both the real and the fake transport.
var _canned
var last_path: String
var last_body: Dictionary
func set_response(resp) -> void:
_canned = resp
func post_json(path: String, body: Dictionary) -> DmResponse:
last_path = path
last_body = body
return _canned