Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,26 @@ def test_pages_kwarg_specified(self, client, formrecognizer_storage_container_sa
assert '1' == poller._polling_method._initial_response.http_response.request.query['pages']
result = poller.result()
assert result


@FormRecognizerPreparer()
@DocumentModelAdministrationClientPreparer()
def test_custom_document_signature_field(self, client, formrecognizer_storage_container_sas_url):
fr_client = client.get_document_analysis_client()

with open(self.form_jpg, "rb") as fd:
myfile = fd.read()

build_polling = client.begin_build_model(formrecognizer_storage_container_sas_url)
model = build_polling.result()

poller = fr_client.begin_analyze_document(
model.model_id,
myfile,
)
result = poller.result()

assert result.documents[0].fields.get("FullSignature").value == "signed"
assert result.documents[0].fields.get("FullSignature").value_type == "signature"
# this will notify us of changes in the service, currently expecting to get a None content for signature type fields
assert result.documents[0].fields.get("FullSignature").content == None
Comment thread
catalinaperalta marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,27 @@ async def test_pages_kwarg_specified(self, client, formrecognizer_storage_contai
assert '1' == poller._polling_method._initial_response.http_response.request.query['pages']
result = await poller.result()
assert result

@FormRecognizerPreparer()
@DocumentModelAdministrationClientPreparer()
async def test_custom_document_signature_field(self, client, formrecognizer_storage_container_sas_url):
fr_client = client.get_document_analysis_client()

with open(self.form_jpg, "rb") as fd:
myfile = fd.read()

async with client:
build_polling = await client.begin_build_model(formrecognizer_storage_container_sas_url)
model = await build_polling.result()

async with fr_client:
poller = await fr_client.begin_analyze_document(
model.model_id,
myfile,
)
result = await poller.result()

assert result.documents[0].fields.get("FullSignature").value == "signed"
assert result.documents[0].fields.get("FullSignature").value_type == "signature"
# this will notify us of changes in the service, currently expecting to get a None content for signature type fields
assert result.documents[0].fields.get("FullSignature").content == None