aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/simple.rs
blob: a15cbf8018fec4af5edb6e31a9e9f923e5534fe0 (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
26
27
28
29
30
31
use crate::common;

#[tokio::test]
async fn test_simple() {
	use aws_sdk_s3::ByteStream;

	let ctx = common::context();
	let bucket = ctx.create_bucket("test-simple");

	let data = ByteStream::from_static(b"Hello world!");

	ctx.client
		.put_object()
		.bucket(&bucket)
		.key("test")
		.body(data)
		.send()
		.await
		.unwrap();

	let res = ctx
		.client
		.get_object()
		.bucket(&bucket)
		.key("test")
		.send()
		.await
		.unwrap();

	assert_bytes_eq!(res.body, b"Hello world!");
}