Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Nov 10, 2024
1 parent ee59055 commit 49a681a
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions aws-s3-transfer-manager/tests/download_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,14 @@ fn simple_object_connector(data: &Bytes, part_size: usize) -> StaticReplayClient
.enumerate()
.map(|(idx, chunk)| {
let start = idx * part_size;
let end = std::cmp::min(start+part_size, data.len()) - 1;
let end = std::cmp::min(start + part_size, data.len()) - 1;
ReplayEvent::new(
// NOTE: Rather than try to recreate all the expected requests we just put in placeholders and
// make our own assertions against the captured requests.
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", end-start+1),
)
.header("Content-Length", format!("{}", end - start + 1))
.header(
"Content-Range",
format!("bytes {start}-{end}/{}", data.len()),
Expand Down Expand Up @@ -231,10 +228,7 @@ async fn test_retry_failed_chunk() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", part_size),
)
.header("Content-Length", format!("{}", part_size))
.header(
"Content-Range",
format!("bytes 0-{}/{}", part_size - 1, data.len()),
Expand All @@ -247,10 +241,7 @@ async fn test_retry_failed_chunk() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", data.len() - part_size),
)
.header("Content-Length", format!("{}", data.len() - part_size))
.header(
"Content-Range",
format!("bytes {}-{}/{}", part_size, data.len(), data.len()),
Expand All @@ -267,10 +258,7 @@ async fn test_retry_failed_chunk() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", data.len() - part_size),
)
.header("Content-Length", format!("{}", data.len() - part_size))
.header(
"Content-Range",
format!("bytes {}-{}/{}", part_size, data.len(), data.len()),
Expand Down Expand Up @@ -317,10 +305,7 @@ async fn test_non_retryable_error() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", part_size),
)
.header("Content-Length", format!("{}", part_size))
.header(
"Content-Range",
format!("bytes 0-{}/{}", part_size - 1, data.len()),
Expand Down Expand Up @@ -367,10 +352,7 @@ async fn test_retry_max_attempts() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", part_size),
)
.header("Content-Length", format!("{}", part_size))
.header(
"Content-Range",
format!("bytes {}-{}/{}", part_size, data.len(), data.len()),
Expand All @@ -390,10 +372,7 @@ async fn test_retry_max_attempts() {
dummy_expected_request(),
http_02x::Response::builder()
.status(200)
.header(
"Content-Length",
format!("{}", part_size),
)
.header("Content-Length", format!("{}", part_size))
.header(
"Content-Range",
format!("bytes 0-{}/{}", part_size - 1, data.len()),
Expand Down

0 comments on commit 49a681a

Please sign in to comment.