Skip to content

Commit

Permalink
test: Sign request signer group ID (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 authored Jan 17, 2024
1 parent 393cfef commit b32ad4a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/integration_new/object/sign_request_itest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,45 @@ def parent_folder():
yield folder


def test_test_sign_request(parent_folder, small_file_path):
with BoxTestFile(parent_folder=parent_folder, file_path=small_file_path) as test_file:
file = {
'id': test_file.object_id,
'type': test_file.object_type,
}
files = [file]
signer1 = {
'email': 'signer1@mail.com',
'signer_group_id': 'reviewer',
}
signer2 = {
'email': 'signer2@mail.com',
'signer_group_id': 'reviewer',
}
signers = [signer1, signer2]

sign_request = CLIENT.create_sign_request(
files=files,
signers=signers,
parent_folder_id=parent_folder.id
)

try:
assert sign_request.id
assert len(sign_request.signers) == 3
signer_group_id = None
signer_count = 0
for signer in sign_request.signers:
if signer['role'] == 'signer':
signer_count += 1
if signer_group_id is None:
signer_group_id = signer['signer_group_id']
assert signer['signer_group_id'] == signer_group_id
assert signer_count == 2
finally:
CLIENT.sign_request(sign_request.id).cancel()


def test_webhook_sign_request(parent_folder, small_file_path):
with BoxTestFile(parent_folder=parent_folder, file_path=small_file_path) as test_file:
file = {
Expand Down

0 comments on commit b32ad4a

Please sign in to comment.