]> git.apps.os.sepia.ceph.com Git - s3-tests.git/commitdiff
boto2: fix byte vs. string comparison in verify_object
authorCasey Bodley <cbodley@redhat.com>
Thu, 21 Sep 2023 14:00:37 +0000 (10:00 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 21 Sep 2023 14:00:39 +0000 (10:00 -0400)
the storage class tests were failing on comparisons between the input
data and output data:

AssertionError: assert 'oFbdZvtRj' == b'oFbdZvtRj'

convert the byte representation back to string for comparison

Signed-off-by: Casey Bodley <cbodley@redhat.com>
s3tests/functional/test_s3.py

index cc70c2461fe8ce7d9a44d020bca00520c0cf138e..0496f3a6faff4542d812317c2b7f8da7a03b17b9 100644 (file)
@@ -290,7 +290,7 @@ def verify_object(bucket, k, data=None, storage_class=None):
     if data:
         read_data = k.get_contents_as_string()
 
-        equal = data == read_data # avoid spamming log if data not equal
+        equal = data == read_data.decode() # avoid spamming log if data not equal
         assert equal == True
 
 def copy_object_storage_class(src_bucket, src_key, dest_bucket, dest_key, storage_class):