fix(python-client): add delete_s3_object (#8216)
* Implement remove_s3_file method Add method to permanently delete a file from S3 bucket. * Add test for removing S3 file Added a test case to verify removal of a file from S3. * Add remove_s3_file function to delete S3 files Added a function to permanently delete a file from the S3 bucket. * Rename remove_s3_file to remove_3_object * Rename remove_3_object to remove_s3_object * Rename test method and update S3 object handling * Rename remove_s3_object to delete_s3_object * Rename test_remove_s3_object to test_delete_s3_object and remove_s3_object to delete_s3_object
This commit is contained in:
@@ -108,6 +108,21 @@ SET s3_secret_access_key='80yMndIMcyXwEujxVNINQbf0tBlIzRaLPyM2m1n4';
|
||||
)
|
||||
print(file_key)
|
||||
|
||||
@unittest.skip("skipping")
|
||||
def test_delete_s3_object(self):
|
||||
# Upload a temporary file
|
||||
s3_obj = wmill.write_s3_file(
|
||||
S3Object(s3="_wmill_test_delete_s3_object.txt"), b"delete_s3_object test content"
|
||||
)
|
||||
# Verify it exists
|
||||
content = wmill.load_s3_file(s3_obj)
|
||||
self.assertEqual(content, b"delete_s3_object test content")
|
||||
# Delete it
|
||||
wmill.delete_s3_object(s3_obj)
|
||||
# Verify it's gone
|
||||
with self.assertRaises(Exception):
|
||||
wmill.load_s3_file(s3_obj)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user