fix(multiplayer): bound adapter HTTP calls

This commit is contained in:
Josh Creek
2026-09-02 19:12:40 +01:00
parent cbefa86c5c
commit 1bce603c33
5 changed files with 36 additions and 11 deletions
+7
View File
@@ -17,6 +17,13 @@ func request() domain.AllocationRequest {
return domain.AllocationRequest{AllocationID: "allocation-1", MatchID: "match-1", Region: "EU", Build: "build-1", Protocol: 1, Transport: "enet"}
}
func TestClientDefaultHTTPTransportHasRequestDeadline(t *testing.T) {
client := (Client{}).httpClient()
if client == http.DefaultClient || client.Timeout != DefaultHTTPTimeout || client.Timeout <= 0 {
t.Fatalf("default HTTP client timeout = %s", client.Timeout)
}
}
func TestAllocateRejectsRankedRequestsWithoutRegisteredArena(t *testing.T) {
client := Client{BaseURL: "http://127.0.0.1:1", Namespace: "games"}
for _, path := range []string{"", "res://scenes/arena_01_elevated.tscn", "res://forged.tscn"} {