Don't check returned storage class if we use NONE

If we haven't set a storage class there's no point in checking the
storage class applied to the object - s3 will choose one.

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
James Hewitt 2022-08-12 16:04:52 +01:00
parent 2d316a12d3
commit 6ceb904c3e
No known key found for this signature in database
GPG key ID: EA6C3C654B6193E4

View file

@ -229,7 +229,9 @@ func TestStorageClass(t *testing.T) {
}
defer resp.Body.Close()
// Amazon only populates this header value for non-standard storage classes
if storageClass == s3.StorageClassStandard && resp.StorageClass != nil {
if storageClass == noStorageClass {
// We haven't specified a storage class so we can't confirm what it is
} else if storageClass == s3.StorageClassStandard && resp.StorageClass != nil {
t.Fatalf(
"unexpected response storage class for file with storage class %v: %v",
storageClass,