mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 10:43:57 +00:00
fixup tests for router change
Signed-off-by: Wolfgang Bumiller <w.bumiller@errno.eu>
This commit is contained in:
parent
8b77b3d08c
commit
a7b9c8d89e
@ -106,7 +106,7 @@ fn check_body(router: &Router<Bytes>, path: &str, expect: &'static str) {
|
|||||||
.get
|
.get
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect("expected GET method on router at path");
|
.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)
|
let resp = futures::executor::block_on(fut)
|
||||||
.expect("expected `GET` on test_body to return successfully");
|
.expect("expected `GET` on test_body to return successfully");
|
||||||
assert!(resp.status() == 200, "test response should have status 200");
|
assert!(resp.status() == 200, "test response should have status 200");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#![feature(async_await)]
|
#![feature(async_await)]
|
||||||
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
|
use serde_json::Value;
|
||||||
|
|
||||||
use proxmox_api::Router;
|
use proxmox_api::Router;
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ fn check_with_matched_params(
|
|||||||
.get
|
.get
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect(&format!("expected GET method on {}", path))
|
.expect(&format!("expected GET method on {}", path))
|
||||||
.call(params);
|
.call(Value::Object(params));
|
||||||
|
|
||||||
let response = futures::executor::block_on(apifut)
|
let response = futures::executor::block_on(apifut)
|
||||||
.expect("expected the simple test api function to be ready immediately");
|
.expect("expected the simple test api function to be ready immediately");
|
||||||
|
Loading…
Reference in New Issue
Block a user