-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
393cfef
commit 31ad420
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 = { | ||
|