Skip to content

Commit a4a6bf9

Browse files
committed
Fixing test in aws_chunked inlineable
1 parent d38a6c5 commit a4a6bf9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

aws/rust-runtime/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/rust-runtime/aws-inlineable/src/aws_chunked.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ mod tests {
184184
file.as_file_mut().write_all(line.as_bytes()).unwrap();
185185
}
186186

187+
let stream_length = file.as_file().metadata().unwrap().len();
187188
let request = HttpRequest::new(
188189
ByteStream::read_from()
189190
.path(&file)
@@ -200,7 +201,7 @@ mod tests {
200201
let interceptor = AwsChunkedContentEncodingInterceptor;
201202
let mut cfg = ConfigBag::base();
202203
cfg.interceptor_state()
203-
.store_put(AwsChunkedBodyOptions::default());
204+
.store_put(AwsChunkedBodyOptions::default().with_stream_length(stream_length));
204205
let runtime_components = RuntimeComponentsBuilder::for_tests().build().unwrap();
205206
let mut ctx = InterceptorContext::new(Input::doesnt_matter());
206207
ctx.enter_serialization_phase();
@@ -220,7 +221,12 @@ mod tests {
220221
body_data.extend_from_slice(&data.unwrap())
221222
}
222223
let body_str = std::str::from_utf8(&body_data).unwrap();
223-
assert!(body_str.ends_with("0\r\n\r\n"));
224+
225+
let expected = "This is a large file created for testing purposes 9999\r\n0\r\n\r\n";
226+
assert!(
227+
body_str.ends_with(expected),
228+
"expected '{body_str}' to end with '{expected}'"
229+
);
224230
}
225231

226232
#[tokio::test]

0 commit comments

Comments
 (0)