diff --git a/test/integration_new/object/sign_request_itest.py b/test/integration_new/object/sign_request_itest.py index 736bfbf2..241060e0 100644 --- a/test/integration_new/object/sign_request_itest.py +++ b/test/integration_new/object/sign_request_itest.py @@ -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 = {