Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add AbortIncompleteMultipartUpload lifecycle rule #765

Merged
merged 6 commits into from
Apr 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
coverage
  • Loading branch information
andrewsg committed Apr 13, 2022
commit e453c065e1d6797874c3378e9482108b35f61a14
17 changes: 16 additions & 1 deletion tests/unit/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ def test_lifecycle_rules_getter(self):
"condition": {"isLive": False},
}
MULTIPART_RULE = {
"action": {"type": "bortIncompleteMultipartUpload"},
"action": {"type": "AbortIncompleteMultipartUpload"},
"condition": {"age": 42},
}
rules = [DELETE_RULE, SSC_RULE, MULTIPART_RULE]
Expand Down Expand Up @@ -2396,6 +2396,21 @@ def test_add_lifecycle_set_storage_class_rule(self):
self.assertEqual([dict(rule) for rule in bucket.lifecycle_rules], rules)
self.assertTrue("lifecycle" in bucket._changes)

def test_add_lifecycle_abort_incomplete_multipart_upload_rule(self):
NAME = "name"
AIMPU_RULE = {
"action": {"type": "AbortIncompleteMultipartUpload"},
"condition": {"age": 42},
}
rules = [AIMPU_RULE]
bucket = self._make_one(name=NAME)
self.assertEqual(list(bucket.lifecycle_rules), [])

bucket.add_lifecycle_abort_incomplete_multipart_upload_rule(age=42)

self.assertEqual([dict(rule) for rule in bucket.lifecycle_rules], rules)
self.assertTrue("lifecycle" in bucket._changes)

def test_cors_getter(self):
NAME = "name"
CORS_ENTRY = {
Expand Down