aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/lib.rs
blob: ab92bc0a6ca811e431aacef3bc73737c9f23048a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[macro_use]
mod common;

mod admin;
mod bucket;

mod s3;

#[cfg(feature = "k2v")]
mod k2v;
#[cfg(feature = "k2v")]
mod k2v_client;

use hyper::{Body, Response};

pub async fn json_body(res: Response<Body>) -> serde_json::Value {
	let res_body: serde_json::Value = serde_json::from_slice(
		&hyper::body::to_bytes(res.into_body())
			.await
			.unwrap()
			.to_vec()[..],
	)
	.unwrap();
	res_body
}