2022-02-02 14:35:52 +00:00
|
|
|
use crate::common;
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn test_simple() {
|
|
|
|
use aws_sdk_s3::ByteStream;
|
|
|
|
|
|
|
|
let ctx = common::context();
|
2022-02-04 16:55:54 +00:00
|
|
|
let bucket = ctx.create_bucket("test-simple");
|
2022-02-02 14:35:52 +00:00
|
|
|
|
|
|
|
let data = ByteStream::from_static(b"Hello world!");
|
|
|
|
|
|
|
|
ctx.client
|
|
|
|
.put_object()
|
2022-02-04 16:55:54 +00:00
|
|
|
.bucket(&bucket)
|
2022-02-02 14:35:52 +00:00
|
|
|
.key("test")
|
|
|
|
.body(data)
|
|
|
|
.send()
|
|
|
|
.await
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
let res = ctx
|
|
|
|
.client
|
|
|
|
.get_object()
|
2022-02-04 16:55:54 +00:00
|
|
|
.bucket(&bucket)
|
2022-02-02 14:35:52 +00:00
|
|
|
.key("test")
|
|
|
|
.send()
|
|
|
|
.await
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
assert_bytes_eq!(res.body, b"Hello world!");
|
|
|
|
}
|