Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions aws/rust-runtime/aws-inlineable/src/aws_chunked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ mod tests {
file.as_file_mut().write_all(line.as_bytes()).unwrap();
}

let stream_length = file.as_file().metadata().unwrap().len();
let request = HttpRequest::new(
ByteStream::read_from()
.path(&file)
Expand All @@ -200,7 +201,7 @@ mod tests {
let interceptor = AwsChunkedContentEncodingInterceptor;
let mut cfg = ConfigBag::base();
cfg.interceptor_state()
.store_put(AwsChunkedBodyOptions::default());
.store_put(AwsChunkedBodyOptions::default().with_stream_length(stream_length));
let runtime_components = RuntimeComponentsBuilder::for_tests().build().unwrap();
let mut ctx = InterceptorContext::new(Input::doesnt_matter());
ctx.enter_serialization_phase();
Expand All @@ -220,7 +221,12 @@ mod tests {
body_data.extend_from_slice(&data.unwrap())
}
let body_str = std::str::from_utf8(&body_data).unwrap();
assert!(body_str.ends_with("0\r\n\r\n"));

let expected = "This is a large file created for testing purposes 9999\r\n0\r\n\r\n";
assert!(
body_str.ends_with(expected),
"expected '{body_str}' to end with '{expected}'"
);
}

#[tokio::test]
Expand Down
Loading