Skip to content

Commit

Permalink
Update get_object_attributes test to account for default checksum
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Passaro <[email protected]>
  • Loading branch information
passaro committed Dec 5, 2024
1 parent 489f2e5 commit b62a40c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mountpoint-s3-client/tests/get_object_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ async fn test_get_attributes() {
let result = result.unwrap();

Check warning on line 199 in mountpoint-s3-client/tests/get_object_attributes.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3-client/tests/get_object_attributes.rs
let etag = result.etag.map(|s| s.trim_matches('"').to_string());
assert_eq!(etag, expected_etag);
assert!(result.checksum.is_none());

// Behavior when uploading without explicitly specifying the checksum algorithm is changing.
// See https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#using-additional-checksums.
// TODO: Review this test when adding support for the new algorithm.
// assert!(result.checksum.is_none());

assert_eq!(result.storage_class, Some(expected_storage_class.to_owned()));
assert_eq!(result.object_size, Some(body.len() as u64));
assert!(result.object_parts.is_none());
Expand Down Expand Up @@ -281,7 +286,10 @@ async fn test_get_attributes_mpu() {
assert_eq!(result.storage_class, Some(expected_storage_class.to_owned()));
assert_eq!(result.object_size, Some(object_size));

assert!(result.checksum.is_none());
// Behavior when uploading without explicitly specifying the checksum algorithm is changing.
// See https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#using-additional-checksums.
// TODO: Review this test when adding support for the new algorithm.
// assert!(result.checksum.is_none());

// object_parts is returned only if the object is using additional checksums.
let object_parts = result.object_parts.unwrap();
Expand Down

0 comments on commit b62a40c

Please sign in to comment.