mirror of
https://github.com/logos-storage/nim-json-rpc.git
synced 2026-01-08 00:23:12 +00:00
Update testerrors ready for async tests (TODO)
This commit is contained in:
parent
e39008fe4a
commit
8781bbbf4e
@ -15,13 +15,18 @@ waitFor client.connect("localhost", Port(8547))
|
||||
server.rpc("rpc") do(a: int, b: int):
|
||||
result = %(&"a: {a}, b: {b}")
|
||||
|
||||
proc testMalformed: Future[Response] =
|
||||
let malformedJson = "{field: 2, \"field: 3}\n"
|
||||
result = client.rawCall("rpc", malformedJson)
|
||||
|
||||
proc testMissingRpc: Future[Response] =
|
||||
result = client.call("phantomRpc", %[])
|
||||
|
||||
suite "RPC Errors":
|
||||
test "Malformed json":
|
||||
expect ValueError:
|
||||
let
|
||||
malformedJson = "{field: 2, \"field: 3}\n"
|
||||
res = waitFor client.rawCall("rpc", malformedJson)
|
||||
let res = waitFor testMalformed()
|
||||
test "Missing RPC":
|
||||
#expect:
|
||||
let res = waitFor client.call("phantomRpc", %[])
|
||||
let res = waitFor testMissingRpc()
|
||||
echo ">>", res
|
||||
echo "Error tests completed"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user