From 3023080509e72c875b68cfa0dad5d4666a0e370b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 21 Sep 2023 10:00:37 -0400 Subject: [PATCH] boto2: fix byte vs. string comparison in verify_object 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 --- s3tests/functional/test_s3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index cc70c24..0496f3a 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -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):