File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff 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 \n 0\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]
You can’t perform that action at this time.
0 commit comments