Skip to content

Commit

Permalink
add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Feb 28, 2023
1 parent ede1aa1 commit 508c198
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/integration_new/object/retention_policy_itest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from test.integration_new import util
from test.integration_new import CLIENT


def test_create_metedata_template_with_fields():
policy_name = 'Test Retention Policy ' + util.random_name()
disposition_action = 'permanently_delete'
retention_length = '1'
retention_type = 'modifiable'
policy_description = 'Test Retention Policy'

retention_policy = CLIENT.create_retention_policy(
policy_name=policy_name,
disposition_action=disposition_action,
retention_length=retention_length,
retention_type=retention_type,
description=policy_description
)

try:
assert retention_policy.policy_name == policy_name
assert retention_policy.disposition_action == disposition_action
assert retention_policy.retention_length == retention_length
assert retention_policy.retention_type == retention_type
assert retention_policy.description == policy_description

new_policy_name = 'Test Retention Policy ' + util.random_name()
new_policy_description = 'Test Retention Policy Updated'
retention_policy.update_info(data={
'policy_name': new_policy_name,
'description': new_policy_description
})

retention_policy = CLIENT.retention_policy(retention_id=retention_policy.object_id).get()
assert retention_policy.policy_name == new_policy_name
assert retention_policy.description == new_policy_description
finally:
retention_policy.update_info(data={
'status': 'retired'
})

0 comments on commit 508c198

Please sign in to comment.