From ba53bd12374fb17b09b24425e0d9ec6c288f8fce Mon Sep 17 00:00:00 2001 From: coffeepots Date: Wed, 13 Jun 2018 19:19:24 +0100 Subject: [PATCH] Update errors to check results are as expected --- tests/testerrors.nim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/testerrors.nim b/tests/testerrors.nim index a55ed35..ad62bd7 100644 --- a/tests/testerrors.nim +++ b/tests/testerrors.nim @@ -34,10 +34,17 @@ proc testInvalidJsonVer: Future[Response] {.async.} = suite "RPC Errors": test "Missing RPC": - let res = waitfor testMissingRpc() + let res = waitFor testMissingRpc() + echo res + check res.error == true and + res.result["message"] == %"Method not found" and + res.result["data"] == %"phantomRpc is not a registered method." test "Incorrect json version": + # Note: We don't expect an exception here, because the server should + # respond with the correct json version let res = waitFor testInvalidJsonVer() + check res.error == true and res.result["message"] == %"JSON 2.0 required" # TODO: Missing ID causes client await to not return next call # For now we can use curl for this test