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

test: Sign request signer group ID #865

Merged
merged 1 commit into from
Jan 17, 2024
Merged
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
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': '[email protected]',
'signer_group_id': 'reviewer',
}
signer2 = {
'email': '[email protected]',
'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
Loading