fixup tests for router change

Signed-off-by: Wolfgang Bumiller <w.bumiller@errno.eu>
This commit is contained in:
Wolfgang Bumiller 2019-08-15 20:26:18 +02:00
parent 8b77b3d08c
commit a7b9c8d89e
2 changed files with 3 additions and 2 deletions

View File

@ -106,7 +106,7 @@ fn check_body(router: &Router<Bytes>, path: &str, expect: &'static str) {
.get
.as_ref()
.expect("expected GET method on router at path");
let fut = method.call(parameters.unwrap_or(Value::Null));
let fut = method.call(parameters.map(Value::Object).unwrap_or(Value::Null));
let resp = futures::executor::block_on(fut)
.expect("expected `GET` on test_body to return successfully");
assert!(resp.status() == 200, "test response should have status 200");

View File

@ -1,6 +1,7 @@
#![feature(async_await)]
use bytes::Bytes;
use serde_json::Value;
use proxmox_api::Router;
@ -65,7 +66,7 @@ fn check_with_matched_params(
.get
.as_ref()
.expect(&format!("expected GET method on {}", path))
.call(params);
.call(Value::Object(params));
let response = futures::executor::block_on(apifut)
.expect("expected the simple test api function to be ready immediately");