Add test for writing to s3