During boto3.resource('s3').Object(bucket, key).get()TypeError raised and invalid json is recorded, while a response is totally valid. bytes type is not json serializable. And response body is a file which is of bytes type. But this is not a reason to raise an error and record invalid json. I propose to stub body with empty value and finish recording without error because lack of file is not an issue for unit testing but invalid record is.
During
boto3.resource('s3').Object(bucket, key).get()
TypeError
raised and invalid json is recorded, while a response is totally valid.bytes
type is not json serializable. And response body is a file which is ofbytes
type. But this is not a reason to raise an error and record invalid json. I propose to stub body with empty value and finish recording without error because lack of file is not an issue for unit testing but invalid record is.