NEO-28: Wrap long lines for gdlint (ability cast + tests).
parent
c3acbdb373
commit
0bce6ed74c
|
|
@ -1,7 +1,8 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
## NEO-31: prototype HTTP client for `POST /game/players/{id}/ability-cast`.
|
## NEO-31: prototype HTTP client for `POST /game/players/{id}/ability-cast`.
|
||||||
## NEO-28: emits [signal cast_result_received] when the response body is JSON [AbilityCastResponse] v1.
|
## NEO-28: emits [signal cast_result_received] when the response body is JSON
|
||||||
|
## [AbilityCastResponse] v1.
|
||||||
signal cast_result_received(accepted: bool, reason_code: String)
|
signal cast_result_received(accepted: bool, reason_code: String)
|
||||||
|
|
||||||
@export var base_url: String = "http://127.0.0.1:5253"
|
@export var base_url: String = "http://127.0.0.1:5253"
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,11 @@ func test_cast_result_received_emits_false_with_reason_on_denied() -> void:
|
||||||
)
|
)
|
||||||
var c := _make_client(transport)
|
var c := _make_client(transport)
|
||||||
var got: Array = []
|
var got: Array = []
|
||||||
c.connect("cast_result_received", func(accepted: bool, reason: String): got.append([accepted, reason]))
|
c.connect(
|
||||||
|
"cast_result_received",
|
||||||
|
func(accepted: bool, reason: String) -> void:
|
||||||
|
got.append([accepted, reason])
|
||||||
|
)
|
||||||
# Act
|
# Act
|
||||||
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))
|
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))
|
||||||
# Assert
|
# Assert
|
||||||
|
|
@ -165,7 +169,11 @@ func test_cast_result_received_emits_true_with_empty_reason_on_accepted() -> voi
|
||||||
transport.enqueue(HTTPRequest.RESULT_SUCCESS, 200, '{"schemaVersion":1,"accepted":true}')
|
transport.enqueue(HTTPRequest.RESULT_SUCCESS, 200, '{"schemaVersion":1,"accepted":true}')
|
||||||
var c := _make_client(transport)
|
var c := _make_client(transport)
|
||||||
var got: Array = []
|
var got: Array = []
|
||||||
c.connect("cast_result_received", func(accepted: bool, reason: String): got.append([accepted, reason]))
|
c.connect(
|
||||||
|
"cast_result_received",
|
||||||
|
func(accepted: bool, reason: String) -> void:
|
||||||
|
got.append([accepted, reason])
|
||||||
|
)
|
||||||
# Act
|
# Act
|
||||||
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", null))
|
var started: bool = bool(c.call("request_cast", 0, "prototype_pulse", null))
|
||||||
# Assert
|
# Assert
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue