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

Tag object_lock tests #580

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
38 changes: 38 additions & 0 deletions s3tests_boto3/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12049,6 +12049,7 @@ def test_bucket_policy_get_obj_acl_existing_tag():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock():
bucket_name = get_new_bucket_name()
client = get_client()
Expand Down Expand Up @@ -12081,6 +12082,7 @@ def test_object_lock_put_obj_lock():
assert response['Status'] == 'Enabled'


@pytest.mark.object_lock
def test_object_lock_put_obj_lock_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12099,6 +12101,7 @@ def test_object_lock_put_obj_lock_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock_with_days_and_years():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12118,6 +12121,7 @@ def test_object_lock_put_obj_lock_with_days_and_years():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock_invalid_days():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12136,6 +12140,7 @@ def test_object_lock_put_obj_lock_invalid_days():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock_invalid_years():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12154,6 +12159,7 @@ def test_object_lock_put_obj_lock_invalid_years():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock_invalid_mode():
bucket_name = get_new_bucket_name()
client = get_client()
Expand Down Expand Up @@ -12184,6 +12190,7 @@ def test_object_lock_put_obj_lock_invalid_mode():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_lock_invalid_status():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12202,6 +12209,7 @@ def test_object_lock_put_obj_lock_invalid_status():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_suspend_versioning():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12213,6 +12221,7 @@ def test_object_lock_suspend_versioning():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_get_obj_lock():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12231,6 +12240,7 @@ def test_object_lock_get_obj_lock():
assert response['ObjectLockConfiguration'] == conf


@pytest.mark.object_lock
def test_object_lock_get_obj_lock_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12242,6 +12252,7 @@ def test_object_lock_get_obj_lock_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12258,6 +12269,7 @@ def test_object_lock_put_obj_retention():



@pytest.mark.object_lock
def test_object_lock_put_obj_retention_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12272,6 +12284,7 @@ def test_object_lock_put_obj_retention_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_invalid_mode():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12292,6 +12305,7 @@ def test_object_lock_put_obj_retention_invalid_mode():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_get_obj_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12307,6 +12321,7 @@ def test_object_lock_get_obj_retention():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_get_obj_retention_iso8601():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12324,6 +12339,7 @@ def test_object_lock_get_obj_retention_iso8601():
client.delete_object(Bucket=bucket_name, Key=key, VersionId=version_id, BypassGovernanceRetention=True)


@pytest.mark.object_lock
def test_object_lock_get_obj_retention_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12337,6 +12353,7 @@ def test_object_lock_get_obj_retention_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_versionid():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12353,6 +12370,7 @@ def test_object_lock_put_obj_retention_versionid():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_override_default_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12378,6 +12396,7 @@ def test_object_lock_put_obj_retention_override_default_retention():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_increase_period():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12395,6 +12414,7 @@ def test_object_lock_put_obj_retention_increase_period():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_shorten_period():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12413,6 +12433,7 @@ def test_object_lock_put_obj_retention_shorten_period():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_obj_retention_shorten_period_bypass():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12430,6 +12451,7 @@ def test_object_lock_put_obj_retention_shorten_period_bypass():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_object_with_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12448,6 +12470,7 @@ def test_object_lock_delete_object_with_retention():
assert response['ResponseMetadata']['HTTPStatusCode'] == 204

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_multipart_object_with_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12473,6 +12496,7 @@ def test_object_lock_delete_multipart_object_with_retention():
assert response['ResponseMetadata']['HTTPStatusCode'] == 204

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_object_with_retention_and_marker():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12498,6 +12522,7 @@ def test_object_lock_delete_object_with_retention_and_marker():
assert response['ResponseMetadata']['HTTPStatusCode'] == 204

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_multi_delete_object_with_retention():
bucket_name = get_new_bucket_name()
client = get_client()
Expand Down Expand Up @@ -12565,6 +12590,7 @@ def test_object_lock_multi_delete_object_with_retention():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_legal_hold():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12578,6 +12604,7 @@ def test_object_lock_put_legal_hold():
assert response['ResponseMetadata']['HTTPStatusCode'] == 200


@pytest.mark.object_lock
def test_object_lock_put_legal_hold_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12592,6 +12619,7 @@ def test_object_lock_put_legal_hold_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_put_legal_hold_invalid_status():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12606,6 +12634,7 @@ def test_object_lock_put_legal_hold_invalid_status():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_get_legal_hold():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12622,6 +12651,7 @@ def test_object_lock_get_legal_hold():
assert response['LegalHold'] == legal_hold_off


@pytest.mark.object_lock
def test_object_lock_get_legal_hold_invalid_bucket():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12635,6 +12665,7 @@ def test_object_lock_get_legal_hold_invalid_bucket():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_object_with_legal_hold_on():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12649,6 +12680,7 @@ def test_object_lock_delete_object_with_legal_hold_on():
client.put_object_legal_hold(Bucket=bucket_name, Key=key, LegalHold={'Status':'OFF'})

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_multipart_object_with_legal_hold_on():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12671,6 +12703,7 @@ def test_object_lock_delete_multipart_object_with_legal_hold_on():
client.put_object_legal_hold(Bucket=bucket_name, Key=key, LegalHold={'Status':'OFF'})

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_delete_object_with_legal_hold_off():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12683,6 +12716,7 @@ def test_object_lock_delete_object_with_legal_hold_off():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_get_obj_metadata():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12703,6 +12737,7 @@ def test_object_lock_get_obj_metadata():


@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_uploading_obj():
bucket_name = get_new_bucket_name()
client = get_client()
Expand All @@ -12719,6 +12754,7 @@ def test_object_lock_uploading_obj():
client.delete_object(Bucket=bucket_name, Key=key, VersionId=response['VersionId'], BypassGovernanceRetention=True)

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_changing_mode_from_governance_with_bypass():
bucket_name = get_new_bucket_name()
key = 'file1'
Expand All @@ -12733,6 +12769,7 @@ def test_object_lock_changing_mode_from_governance_with_bypass():
client.put_object_retention(Bucket=bucket_name, Key=key, Retention=retention, BypassGovernanceRetention=True)

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_changing_mode_from_governance_without_bypass():
bucket_name = get_new_bucket_name()
key = 'file1'
Expand All @@ -12750,6 +12787,7 @@ def test_object_lock_changing_mode_from_governance_without_bypass():
assert error_code == 'AccessDenied'

@pytest.mark.fails_on_dbstore
@pytest.mark.object_lock
def test_object_lock_changing_mode_from_compliance():
bucket_name = get_new_bucket_name()
key = 'file1'
Expand Down