From 0e53741a2b7b570d32d94163640612e30b0d03a1 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Thu, 11 Feb 2021 10:48:44 -0800 Subject: [PATCH 1/8] remove authentication key success tests --- .../tests/test_business_card.py | 8 -------- .../tests/test_business_card_async.py | 12 ------------ .../tests/test_business_card_from_url.py | 6 ------ .../tests/test_business_card_from_url_async.py | 7 ------- .../azure-ai-formrecognizer/tests/test_content.py | 8 -------- .../tests/test_content_async.py | 9 --------- .../tests/test_content_from_url.py | 6 ------ .../tests/test_content_from_url_async.py | 7 ------- .../azure-ai-formrecognizer/tests/test_invoice.py | 8 -------- .../tests/test_invoice_async.py | 9 --------- .../tests/test_invoice_from_url.py | 6 ------ .../tests/test_invoice_from_url_async.py | 7 ------- .../azure-ai-formrecognizer/tests/test_receipt.py | 8 -------- .../tests/test_receipt_async.py | 9 --------- .../tests/test_receipt_from_url_async.py | 9 --------- 15 files changed, 119 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py index eeb19846286c..ba08bab45d52 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py @@ -31,14 +31,6 @@ def test_business_card_bad_endpoint(self, formrecognizer_test_endpoint, formreco client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_business_cards(myfile) - @FormRecognizerPreparer() - def test_authentication_successful_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): - client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential(formrecognizer_test_api_key)) - with open(self.business_card_jpg, "rb") as fd: - myfile = fd.read() - poller = client.begin_recognize_business_cards(myfile) - result = poller.result() - @FormRecognizerPreparer() def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index e087fc2a864a..576445a3d0c2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -33,15 +33,6 @@ async def test_business_card_bad_endpoint(self, formrecognizer_test_endpoint, fo async with client: poller = await client.begin_recognize_business_cards(myfile) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_authentication_successful_key(self, client): - with open(self.business_card_jpg, "rb") as fd: - myfile = fd.read() - async with client: - poller = await client.begin_recognize_business_cards(myfile) - result = await poller.result() - @FormRecognizerPreparer() async def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) @@ -105,7 +96,6 @@ async def test_damaged_file_bytes_io_fails_autodetect(self, client): @FormRecognizerPreparer() @GlobalClientPreparer() async def test_blank_page(self, client): - with open(self.blank_pdf, "rb") as fd: blank = fd.read() async with client: @@ -137,7 +127,6 @@ async def test_passing_unsupported_url_content_type(self, client): @FormRecognizerPreparer() @GlobalClientPreparer() async def test_auto_detect_unsupported_stream_content(self, client): - with open(self.unsupported_content_py, "rb") as fd: myfile = fd.read() @@ -361,7 +350,6 @@ async def test_business_card_png(self, client): @FormRecognizerPreparer() @GlobalClientPreparer() async def test_business_card_multipage_pdf(self, client): - with open(self.business_card_multipage_pdf, "rb") as fd: receipt = fd.read() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py index 02c5de22b888..6660be506cdd 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py @@ -49,12 +49,6 @@ def test_business_card_url_bad_endpoint(self, formrecognizer_test_endpoint, form client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_authentication_successful_key(self, client): - poller = client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - result = poller.result() - @FormRecognizerPreparer() def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py index 1be2acce25dc..89ca23bc7af0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py @@ -53,13 +53,6 @@ async def test_business_card_url_bad_endpoint(self, formrecognizer_test_endpoint async with client: poller = await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_authentication_successful_key(self, client): - async with client: - poller = await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - result = await poller.result() - @FormRecognizerPreparer() async def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py index 8b139aaee24e..907675f8cff5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py @@ -29,14 +29,6 @@ def test_content_bad_endpoint(self, formrecognizer_test_endpoint, formrecognizer client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_content(myfile) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_content_authentication_successful_key(self, client): - with open(self.invoice_pdf, "rb") as fd: - myfile = fd.read() - poller = client.begin_recognize_content(myfile) - result = poller.result() - @FormRecognizerPreparer() def test_content_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py index e39ceebfea7c..8cb1e6f81f35 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_async.py @@ -33,15 +33,6 @@ async def test_content_bad_endpoint(self, formrecognizer_test_endpoint, formreco poller = await client.begin_recognize_content(myfile) result = await poller.result() - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_content_authentication_successful_key(self, client): - with open(self.invoice_pdf, "rb") as fd: - myfile = fd.read() - async with client: - poller = await client.begin_recognize_content(myfile) - result = await poller.result() - @FormRecognizerPreparer() async def test_content_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py index 93b778be6c7e..db592df03d29 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url.py @@ -35,12 +35,6 @@ def test_content_url_bad_endpoint(self, formrecognizer_test_endpoint, formrecogn client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_content_from_url(self.invoice_url_pdf) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_content_url_auth_successful_key(self, client): - poller = client.begin_recognize_content_from_url(self.invoice_url_pdf) - result = poller.result() - @FormRecognizerPreparer() def test_content_url_auth_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py index d7bf30968ec7..33ef36b1e29a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content_from_url_async.py @@ -38,13 +38,6 @@ async def test_content_url_bad_endpoint(self, formrecognizer_test_endpoint, form poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) result = await poller.result() - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_content_url_auth_successful_key(self, client): - async with client: - poller = await client.begin_recognize_content_from_url(self.invoice_url_pdf) - result = await poller.result() - @FormRecognizerPreparer() async def test_content_url_auth_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py index 0190cb227baf..4c10dba54ad8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py @@ -30,14 +30,6 @@ def test_invoice_bad_endpoint(self, formrecognizer_test_endpoint, formrecognizer client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_invoices(myfile) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_authentication_successful_key(self, client): - with open(self.invoice_pdf, "rb") as fd: - myfile = fd.read() - poller = client.begin_recognize_invoices(myfile) - result = poller.result() - @FormRecognizerPreparer() def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py index cdc30a8473e8..61d41828e679 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_async.py @@ -33,15 +33,6 @@ async def test_invoice_bad_endpoint(self, formrecognizer_test_endpoint, formreco async with client: poller = await client.begin_recognize_invoices(myfile) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_authentication_successful_key(self, client): - with open(self.invoice_pdf, "rb") as fd: - myfile = fd.read() - async with client: - poller = await client.begin_recognize_invoices(myfile) - result = await poller.result() - @FormRecognizerPreparer() async def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py index 0b078d864fc0..8c653c382525 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py @@ -48,12 +48,6 @@ def test_invoice_url_bad_endpoint(self, formrecognizer_test_endpoint, formrecogn client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_authentication_successful_key(self, client): - poller = client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - result = poller.result() - @FormRecognizerPreparer() def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py index 03ddac308b56..bf20befc3178 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py @@ -53,13 +53,6 @@ async def test_invoice_url_bad_endpoint(self, formrecognizer_test_endpoint, form async with client: poller = await client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_authentication_successful_key(self, client): - async with client: - poller = await client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - result = await poller.result() - @FormRecognizerPreparer() async def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index 68c2d28d131c..436e0a7839b1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -30,14 +30,6 @@ def test_receipt_bad_endpoint(self, formrecognizer_test_endpoint, formrecognizer client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_receipts(myfile) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_authentication_successful_key(self, client): - with open(self.receipt_jpg, "rb") as fd: - myfile = fd.read() - poller = client.begin_recognize_receipts(myfile) - result = poller.result() - @FormRecognizerPreparer() def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index 30c0a5f2524e..76d195438554 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -34,15 +34,6 @@ async def test_receipt_bad_endpoint(self, formrecognizer_test_endpoint, formreco poller = await client.begin_recognize_receipts(myfile) result = await poller.result() - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_authentication_successful_key(self, client): - with open(self.receipt_jpg, "rb") as fd: - myfile = fd.read() - async with client: - poller = await client.begin_recognize_receipts(myfile) - result = await poller.result() - @FormRecognizerPreparer() async def test_authentication_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index cdfa91cdebed..4e72704650ab 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -67,15 +67,6 @@ async def test_receipt_url_bad_endpoint(self, formrecognizer_test_endpoint, form ) result = await poller.result() - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_receipt_url_auth_successful_key(self, client): - async with client: - poller = await client.begin_recognize_receipts_from_url( - self.receipt_url_jpg - ) - result = await poller.result() - @FormRecognizerPreparer() async def test_receipt_url_auth_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) From 6a7039e1d0159bfeecd092f74ecee7aafc444655 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 12 Feb 2021 08:32:42 -0800 Subject: [PATCH 2/8] combine jpeg tests-business card async --- .../tests/test_business_card_async.py | 84 ++++++++----------- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index 576445a3d0c2..297c2135df64 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -253,54 +253,6 @@ def callback(raw_response, _, headers): # Check page metadata self.assertFormPagesTransformCorrect(returned_model, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_business_card_jpg(self, client): - - with open(self.business_card_jpg, "rb") as fd: - business_card = fd.read() - - async with client: - poller = await client.begin_recognize_business_cards(business_card) - result = await poller.result() - - self.assertEqual(len(result), 1) - business_card = result[0] - # check dict values - self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') - - self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) - self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") - - self.assertEqual(len(business_card.fields.get("Departments").value), 1) - self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") - - self.assertEqual(len(business_card.fields.get("Emails").value), 1) - self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") - - self.assertEqual(len(business_card.fields.get("Websites").value), 1) - self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") - - # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 - # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) - # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) - # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) - # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") - - self.assertEqual(len(business_card.fields.get("Addresses").value), 1) - self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") - - self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) - self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") - - @FormRecognizerPreparer() @GlobalClientPreparer() async def test_business_card_png(self, client): @@ -427,6 +379,42 @@ async def test_business_card_jpg_include_field_elements(self, client): for name, field in business_card.fields.items(): for f in field.value: self.assertFieldElementsHasValues(f.value_data.field_elements, business_card.page_range.first_page_number) + + self.assertEqual(len(result), 1) + business_card = result[0] + # check dict values + self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') + + self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) + self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") + + self.assertEqual(len(business_card.fields.get("Departments").value), 1) + self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") + + self.assertEqual(len(business_card.fields.get("Emails").value), 1) + self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") + + self.assertEqual(len(business_card.fields.get("Websites").value), 1) + self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") + + # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 + # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) + # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) + # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) + # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") + + self.assertEqual(len(business_card.fields.get("Addresses").value), 1) + self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") + + self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) + self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") @FormRecognizerPreparer() @GlobalClientPreparer() From d40b7907e5c3b66b7271e55b99ba7c36567957dd Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 12 Feb 2021 09:12:40 -0800 Subject: [PATCH 3/8] combine more jpg tests for business cards --- .../tests/test_business_card.py | 80 ++++++++----------- .../tests/test_business_card_async.py | 4 +- .../tests/test_business_card_from_url.py | 76 ++++++++---------- .../test_business_card_from_url_async.py | 77 ++++++++---------- 4 files changed, 103 insertions(+), 134 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py index ba08bab45d52..25248c295948 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card.py @@ -241,52 +241,6 @@ def callback(raw_response, _, headers): # Check page metadata self.assertFormPagesTransformCorrect(returned_model, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_business_card_jpg(self, client): - - with open(self.business_card_jpg, "rb") as fd: - business_card = fd.read() - - poller = client.begin_recognize_business_cards(business_card) - - result = poller.result() - self.assertEqual(len(result), 1) - business_card = result[0] - # check dict values - self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') - - self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) - self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") - - self.assertEqual(len(business_card.fields.get("Departments").value), 1) - self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") - - self.assertEqual(len(business_card.fields.get("Emails").value), 1) - self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") - - self.assertEqual(len(business_card.fields.get("Websites").value), 1) - self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") - - # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 - # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) - # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) - # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) - # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") - - self.assertEqual(len(business_card.fields.get("Addresses").value), 1) - self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") - - self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) - self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") - @FormRecognizerPreparer() @GlobalClientPreparer() def test_business_card_png(self, client): @@ -410,6 +364,40 @@ def test_business_card_jpg_include_field_elements(self, client): for name, field in business_card.fields.items(): for f in field.value: self.assertFieldElementsHasValues(f.value_data.field_elements, business_card.page_range.first_page_number) + + # check dict values + self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') + + self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) + self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") + + self.assertEqual(len(business_card.fields.get("Departments").value), 1) + self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") + + self.assertEqual(len(business_card.fields.get("Emails").value), 1) + self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") + + self.assertEqual(len(business_card.fields.get("Websites").value), 1) + self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") + + # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 + # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) + # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) + # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) + # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") + + self.assertEqual(len(business_card.fields.get("Addresses").value), 1) + self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") + + self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) + self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py index 297c2135df64..a82093244736 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_async.py @@ -379,9 +379,7 @@ async def test_business_card_jpg_include_field_elements(self, client): for name, field in business_card.fields.items(): for f in field.value: self.assertFieldElementsHasValues(f.value_data.field_elements, business_card.page_range.first_page_number) - - self.assertEqual(len(result), 1) - business_card = result[0] + # check dict values self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py index 6660be506cdd..f281eea91dbc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url.py @@ -174,48 +174,6 @@ def callback(raw_response, _, headers): # Check page metadata self.assertFormPagesTransformCorrect(returned_model, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_business_card_jpg(self, client): - poller = client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - - result = poller.result() - self.assertEqual(len(result), 1) - business_card = result[0] - # check dict values - self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') - - self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) - self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") - - self.assertEqual(len(business_card.fields.get("Departments").value), 1) - self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") - - self.assertEqual(len(business_card.fields.get("Emails").value), 1) - self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") - - self.assertEqual(len(business_card.fields.get("Websites").value), 1) - self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") - - # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 - # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) - # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) - # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) - # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") - - self.assertEqual(len(business_card.fields.get("Addresses").value), 1) - self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") - - self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) - self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") - @FormRecognizerPreparer() @GlobalClientPreparer() def test_business_card_png(self, client): @@ -333,6 +291,40 @@ def test_business_card_jpg_include_field_elements(self, client): for name, field in business_card.fields.items(): for f in field.value: self.assertFieldElementsHasValues(f.value_data.field_elements, business_card.page_range.first_page_number) + + # check dict values + self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') + + self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) + self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") + + self.assertEqual(len(business_card.fields.get("Departments").value), 1) + self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") + + self.assertEqual(len(business_card.fields.get("Emails").value), 1) + self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") + + self.assertEqual(len(business_card.fields.get("Websites").value), 1) + self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") + + # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 + # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) + # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) + # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) + # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") + + self.assertEqual(len(business_card.fields.get("Addresses").value), 1) + self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") + + self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) + self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py index 89ca23bc7af0..423de58a2931 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_business_card_from_url_async.py @@ -184,49 +184,6 @@ def callback(raw_response, _, headers): # Check page metadata self.assertFormPagesTransformCorrect(returned_model, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_business_card_jpg(self, client): - async with client: - poller = await client.begin_recognize_business_cards_from_url(self.business_card_url_jpg) - - result = await poller.result() - self.assertEqual(len(result), 1) - business_card = result[0] - # check dict values - self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') - self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') - - self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) - self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") - - self.assertEqual(len(business_card.fields.get("Departments").value), 1) - self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") - - self.assertEqual(len(business_card.fields.get("Emails").value), 1) - self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") - - self.assertEqual(len(business_card.fields.get("Websites").value), 1) - self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") - - # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 - # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) - # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) - # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") - - # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) - # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") - - self.assertEqual(len(business_card.fields.get("Addresses").value), 1) - self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") - - self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) - self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") - @FormRecognizerPreparer() @GlobalClientPreparer() async def test_business_card_png(self, client): @@ -348,6 +305,40 @@ async def test_business_card_jpg_include_field_elements(self, client): for f in field.value: self.assertFieldElementsHasValues(f.value_data.field_elements, business_card.page_range.first_page_number) + # check dict values + self.assertEqual(len(business_card.fields.get("ContactNames").value), 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value_data.page_number, 1) + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['FirstName'].value, 'Avery') + self.assertEqual(business_card.fields.get("ContactNames").value[0].value['LastName'].value, 'Smith') + + self.assertEqual(len(business_card.fields.get("JobTitles").value), 1) + self.assertEqual(business_card.fields.get("JobTitles").value[0].value, "Senior Researcher") + + self.assertEqual(len(business_card.fields.get("Departments").value), 1) + self.assertEqual(business_card.fields.get("Departments").value[0].value, "Cloud & Al Department") + + self.assertEqual(len(business_card.fields.get("Emails").value), 1) + self.assertEqual(business_card.fields.get("Emails").value[0].value, "avery.smith@contoso.com") + + self.assertEqual(len(business_card.fields.get("Websites").value), 1) + self.assertEqual(business_card.fields.get("Websites").value[0].value, "https://www.contoso.com/") + + # FIXME: uncomment https://github.com/Azure/azure-sdk-for-python/issues/14300 + # self.assertEqual(len(business_card.fields.get("MobilePhones").value), 1) + # self.assertEqual(business_card.fields.get("MobilePhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("OtherPhones").value), 1) + # self.assertEqual(business_card.fields.get("OtherPhones").value[0].value, "https://www.contoso.com/") + + # self.assertEqual(len(business_card.fields.get("Faxes").value), 1) + # self.assertEqual(business_card.fields.get("Faxes").value[0].value, "https://www.contoso.com/") + + self.assertEqual(len(business_card.fields.get("Addresses").value), 1) + self.assertEqual(business_card.fields.get("Addresses").value[0].value, "2 Kingdom Street Paddington, London, W2 6BD") + + self.assertEqual(len(business_card.fields.get("CompanyNames").value), 1) + self.assertEqual(business_card.fields.get("CompanyNames").value[0].value, "Contoso") + @FormRecognizerPreparer() @GlobalClientPreparer() @pytest.mark.live_test_only From ecb451028fc6ea161063f5eade8dc6d2e82d42cc Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 12 Feb 2021 10:00:29 -0800 Subject: [PATCH 4/8] remove redundant compose tests --- .../tests/test_compose_model.py | 10 ---------- .../tests/test_compose_model_async.py | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py index 6bcdc1a264ad..0972c6558b61 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model.py @@ -65,16 +65,6 @@ def test_compose_model_invalid_unlabeled_models(self, client, formrecognizer_sto self.assertEqual(e.value.error.code, "1001") self.assertIsNotNone(e.value.error.message) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_compose_model_invalid_model(self, client, formrecognizer_storage_container_sas_url): - - with pytest.raises(HttpResponseError) as e: - poller = client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000"]) - composed_model = poller.result() - self.assertEqual(e.value.error.code, "1001") - self.assertIsNotNone(e.value.error.message) - @FormRecognizerPreparer() @GlobalClientPreparer() @pytest.mark.live_test_only diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py index c0bc9fd695c0..660ab4f294a4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_compose_model_async.py @@ -66,16 +66,6 @@ async def test_compose_model_invalid_unlabeled_models(self, client, formrecogniz self.assertEqual(e.value.error.code, "1001") self.assertIsNotNone(e.value.error.message) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_compose_model_invalid_model(self, client, formrecognizer_storage_container_sas_url): - async with client: - with pytest.raises(HttpResponseError) as e: - poller = await client.begin_create_composed_model(["00000000-0000-0000-0000-000000000000"]) - composed_model = await poller.result() - self.assertEqual(e.value.error.code, "1001") - self.assertIsNotNone(e.value.error.message) - @FormRecognizerPreparer() @GlobalClientPreparer() @pytest.mark.live_test_only From d937029d16c0328e0d59439dd9422724a5eaeaea Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Tue, 16 Feb 2021 10:48:42 -0800 Subject: [PATCH 5/8] clean up receipt tests --- .../tests/test_receipt.py | 45 +++++++----------- .../tests/test_receipt_async.py | 46 +++++++------------ .../tests/test_receipt_from_url.py | 16 ------- .../tests/test_receipt_from_url_async.py | 15 +----- 4 files changed, 33 insertions(+), 89 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index 436e0a7839b1..8d5a9285e029 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -202,35 +202,6 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(receipt.pages, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_receipt_jpg(self, client): - - with open(self.receipt_jpg, "rb") as fd: - receipt = fd.read() - - poller = client.begin_recognize_receipts(receipt) - - result = poller.result() - self.assertEqual(len(result), 1) - receipt = result[0] - self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') - self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') - self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) - self.assertEqual(receipt.fields.get("Tax").value, 1.17) - self.assertEqual(receipt.fields.get("Tip").value, 1.63) - self.assertEqual(receipt.fields.get("Total").value, 14.5) - self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) - self.assertEqual(receipt.page_range.first_page_number, 1) - self.assertEqual(receipt.page_range.last_page_number, 1) - self.assertFormPagesHasValues(receipt.pages) - receipt_type = receipt.fields.get("ReceiptType") - self.assertIsNotNone(receipt_type.confidence) - self.assertEqual(receipt_type.value, 'Itemized') - self.assertReceiptItemsHasValues(receipt.fields['Items'].value, receipt.page_range.first_page_number, False) - @FormRecognizerPreparer() @GlobalClientPreparer() def test_receipt_png(self, client): @@ -271,6 +242,22 @@ def test_receipt_jpg_include_field_elements(self, client): for name, field in receipt.fields.items(): if field.value_type not in ["list", "dictionary"] and name != "ReceiptType": # receipt cases where value_data is None self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) + + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.page_range.first_page_number, 1) + self.assertEqual(receipt.page_range.last_page_number, 1) + self.assertFormPagesHasValues(receipt.pages) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index 76d195438554..18832f53c25d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -226,36 +226,6 @@ def callback(raw_response, _, headers): # Check form pages self.assertFormPagesTransformCorrect(receipt.pages, read_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_receipt_jpg(self, client): - - with open(self.receipt_jpg, "rb") as fd: - receipt = fd.read() - - async with client: - poller = await client.begin_recognize_receipts(receipt) - result = await poller.result() - - self.assertEqual(len(result), 1) - receipt = result[0] - self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') - self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') - self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') - self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) - self.assertEqual(receipt.fields.get("Tax").value, 1.17) - self.assertEqual(receipt.fields.get("Tip").value, 1.63) - self.assertEqual(receipt.fields.get("Total").value, 14.5) - self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) - self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) - self.assertEqual(receipt.page_range.first_page_number, 1) - self.assertEqual(receipt.page_range.last_page_number, 1) - self.assertFormPagesHasValues(receipt.pages) - receipt_type = receipt.fields.get("ReceiptType") - self.assertIsNotNone(receipt_type.confidence) - self.assertEqual(receipt_type.value, 'Itemized') - self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) - @FormRecognizerPreparer() @GlobalClientPreparer() async def test_receipt_png(self, client): @@ -299,6 +269,22 @@ async def test_receipt_jpg_include_field_elements(self, client): if field.value_type not in ["list", "dictionary"] and name != "ReceiptType": # receipt cases where value_data is None self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') + self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') + self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') + self.assertEqual(receipt.fields.get("Subtotal").value, 11.7) + self.assertEqual(receipt.fields.get("Tax").value, 1.17) + self.assertEqual(receipt.fields.get("Tip").value, 1.63) + self.assertEqual(receipt.fields.get("Total").value, 14.5) + self.assertEqual(receipt.fields.get("TransactionDate").value, date(year=2019, month=6, day=10)) + self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) + self.assertEqual(receipt.page_range.first_page_number, 1) + self.assertEqual(receipt.page_range.last_page_number, 1) + self.assertFormPagesHasValues(receipt.pages) + receipt_type = receipt.fields.get("ReceiptType") + self.assertIsNotNone(receipt_type.confidence) + self.assertEqual(receipt_type.value, 'Itemized') + @FormRecognizerPreparer() @GlobalClientPreparer() async def test_receipt_multipage(self, client): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index 47052c921050..79749dba4850 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -56,12 +56,6 @@ def test_receipt_url_bad_endpoint(self, formrecognizer_test_endpoint, formrecogn client = FormRecognizerClient("http://notreal.azure.com", AzureKeyCredential(formrecognizer_test_api_key)) poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_receipt_url_auth_successful_key(self, client): - poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg) - result = poller.result() - @FormRecognizerPreparer() def test_receipt_url_auth_bad_key(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential("xxxx")) @@ -171,15 +165,6 @@ def test_receipt_url_include_field_elements(self, client): if field.value_type not in ["list", "dictionary"] and name != "ReceiptType": # receipt cases where value_data is None self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_receipt_url_jpg(self, client): - - poller = client.begin_recognize_receipts_from_url(self.receipt_url_jpg) - - result = poller.result() - self.assertEqual(len(result), 1) - receipt = result[0] self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') @@ -195,7 +180,6 @@ def test_receipt_url_jpg(self, client): receipt_type = receipt.fields.get("ReceiptType") self.assertIsNotNone(receipt_type.confidence) self.assertEqual(receipt_type.value, 'Itemized') - self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index 4e72704650ab..2dcf41c2aa4b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -189,19 +189,7 @@ async def test_receipt_url_include_field_elements(self, client): for name, field in receipt.fields.items(): if field.value_type not in ["list", "dictionary"] and name != "ReceiptType": # receipt cases where value_data is None self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) - - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_receipt_url_jpg(self, client): - - async with client: - poller = await client.begin_recognize_receipts_from_url( - self.receipt_url_jpg - ) - result = await poller.result() - - self.assertEqual(len(result), 1) - receipt = result[0] + self.assertEqual(receipt.fields.get("MerchantAddress").value, '123 Main Street Redmond, WA 98052') self.assertEqual(receipt.fields.get("MerchantName").value, 'Contoso Contoso') self.assertEqual(receipt.fields.get("MerchantPhoneNumber").value, '+19876543210') @@ -217,7 +205,6 @@ async def test_receipt_url_jpg(self, client): receipt_type = receipt.fields.get("ReceiptType") self.assertIsNotNone(receipt_type.confidence) self.assertEqual(receipt_type.value, 'Itemized') - self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, False) @FormRecognizerPreparer() @GlobalClientPreparer() From 9d0c2ddac6213585b5e5d8a52d1029c0c8e73d82 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Tue, 16 Feb 2021 10:49:17 -0800 Subject: [PATCH 6/8] clean up pdf tests --- .../tests/test_invoice.py | 35 ++++++------------- .../tests/test_invoice_from_url.py | 31 ++++++---------- .../tests/test_invoice_from_url_async.py | 32 ++++++----------- 3 files changed, 33 insertions(+), 65 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py index 4c10dba54ad8..5de99d0d3f65 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice.py @@ -244,30 +244,6 @@ def callback(raw_response, _, headers): self.assertFormPagesTransformCorrect(returned_model.pages, read_results, page_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_invoice_pdf(self, client): - - with open(self.invoice_pdf, "rb") as fd: - invoice = fd.read() - - poller = client.begin_recognize_invoices(invoice) - - result = poller.result() - self.assertEqual(len(result), 1) - invoice = result[0] - # check dict values - - self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") - self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') - self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") - self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') - self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") - self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') - self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) - self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) - self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) - @FormRecognizerPreparer() @GlobalClientPreparer() def test_invoice_tiff(self, client): @@ -333,6 +309,17 @@ def test_invoice_pdf_include_field_elements(self, client): for field in invoice.fields.values(): self.assertFieldElementsHasValues(field.value_data.field_elements, invoice.page_range.first_page_number) + # check dict values + self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") + self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') + self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") + self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') + self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") + self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') + self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) + self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) + self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) + @FormRecognizerPreparer() @GlobalClientPreparer() @pytest.mark.live_test_only diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py index 8c653c382525..e79c8032d28d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url.py @@ -177,26 +177,6 @@ def callback(raw_response, _, headers): self.assertFormPagesTransformCorrect(returned_model.pages, read_results, page_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - def test_invoice_pdf(self, client): - poller = client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - - result = poller.result() - self.assertEqual(len(result), 1) - invoice = result[0] - - # check dict values - self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") - self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') - self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") - self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') - self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") - self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') - self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) - self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) - self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) - @FormRecognizerPreparer() @GlobalClientPreparer() def test_invoice_tiff(self, client): @@ -255,6 +235,17 @@ def test_invoice_pdf_include_field_elements(self, client): for field in invoice.fields.values(): self.assertFieldElementsHasValues(field.value_data.field_elements, invoice.page_range.first_page_number) + + # check dict values + self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") + self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') + self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") + self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') + self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") + self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') + self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) + self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) + self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py index bf20befc3178..1cc2b8ed9332 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_invoice_from_url_async.py @@ -188,27 +188,6 @@ def callback(raw_response, _, headers): self.assertFormPagesTransformCorrect(returned_model.pages, read_results, page_results) - @FormRecognizerPreparer() - @GlobalClientPreparer() - async def test_invoice_pdf(self, client): - async with client: - poller = await client.begin_recognize_invoices_from_url(self.invoice_url_pdf) - - result = await poller.result() - self.assertEqual(len(result), 1) - invoice = result[0] - - # check dict values - self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") - self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') - self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") - self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') - self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") - self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') - self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) - self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) - self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) - @FormRecognizerPreparer() @GlobalClientPreparer() async def test_invoice_tiff(self, client): @@ -270,6 +249,17 @@ async def test_invoice_pdf_include_field_elements(self, client): for field in invoice.fields.values(): self.assertFieldElementsHasValues(field.value_data.field_elements, invoice.page_range.first_page_number) + + # check dict values + self.assertEqual(invoice.fields.get("VendorName").value, "Contoso") + self.assertEqual(invoice.fields.get("VendorAddress").value, '1 Redmond way Suite 6000 Redmond, WA 99243') + self.assertEqual(invoice.fields.get("CustomerAddressRecipient").value, "Microsoft") + self.assertEqual(invoice.fields.get("CustomerAddress").value, '1020 Enterprise Way Sunnayvale, CA 87659') + self.assertEqual(invoice.fields.get("CustomerName").value, "Microsoft") + self.assertEqual(invoice.fields.get("InvoiceId").value, '34278587') + self.assertEqual(invoice.fields.get("InvoiceDate").value, date(2017, 6, 18)) + self.assertEqual(invoice.fields.get("InvoiceTotal").value, 56651.49) + self.assertEqual(invoice.fields.get("DueDate").value, date(2017, 6, 24)) @FormRecognizerPreparer() @GlobalClientPreparer() From 478529ca60d558d19ed4297dc63ef2f1dfa39071 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Tue, 16 Feb 2021 10:49:36 -0800 Subject: [PATCH 7/8] clean up custom forms test --- .../tests/test_custom_forms_from_url.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py index 12ddf48d0ada..1e293390f575 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py @@ -55,13 +55,6 @@ def test_url_authentication_bad_key(self, formrecognizer_test_endpoint, formreco with self.assertRaises(ClientAuthenticationError): result = client.begin_recognize_custom_forms_from_url(model_id="xx", form_url=self.form_url_jpg) - @FormRecognizerPreparer() - def test_passing_bad_url(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): - client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential(formrecognizer_test_api_key)) - - with self.assertRaises(HttpResponseError): - poller = client.begin_recognize_custom_forms_from_url(model_id="xx", form_url="https://badurl.jpg") - @FormRecognizerPreparer() def test_pass_stream_into_url(self, formrecognizer_test_endpoint, formrecognizer_test_api_key): client = FormRecognizerClient(formrecognizer_test_endpoint, AzureKeyCredential(formrecognizer_test_api_key)) From 4bea0951f9561b3b121d71750d04a27b53119d5d Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 22 Feb 2021 09:31:52 -0800 Subject: [PATCH 8/8] address comments --- ...rd.test_authentication_successful_key.yaml | 112 --------- ..._business_card.test_business_card_jpg.yaml | 112 --------- ...nc.test_authentication_successful_key.yaml | 88 ------- ...ess_card_async.test_business_card_jpg.yaml | 88 ------- ...rl.test_authentication_successful_key.yaml | 111 --------- ..._card_from_url.test_business_card_jpg.yaml | 111 --------- ...nc.test_authentication_successful_key.yaml | 89 ------- ...from_url_async.test_business_card_jpg.yaml | 89 ------- ...odel.test_compose_model_invalid_model.yaml | 41 ---- ...sync.test_compose_model_invalid_model.yaml | 31 --- ...content_authentication_successful_key.yaml | 198 --------------- ...content_authentication_successful_key.yaml | 197 --------------- ....test_content_url_auth_successful_key.yaml | 232 ------------------ ....test_content_url_auth_successful_key.yaml | 198 --------------- ...m_forms_from_url.test_passing_bad_url.yaml | 41 ---- ...ce.test_authentication_successful_key.yaml | 159 ------------ .../test_invoice.test_invoice_pdf.yaml | 159 ------------ ...nc.test_authentication_successful_key.yaml | 123 ---------- ...rl.test_authentication_successful_key.yaml | 158 ------------ ...est_invoice_from_url.test_invoice_pdf.yaml | 158 ------------ ...nc.test_authentication_successful_key.yaml | 124 ---------- ...voice_from_url_async.test_invoice_pdf.yaml | 124 ---------- ...pt.test_authentication_successful_key.yaml | 115 --------- .../test_receipt.test_receipt_jpg.yaml | 115 --------- ...nc.test_authentication_successful_key.yaml | 91 ------- .../test_receipt_async.test_receipt_jpg.yaml | 91 ------- ....test_receipt_url_auth_successful_key.yaml | 114 --------- ...receipt_from_url.test_receipt_url_jpg.yaml | 114 --------- ....test_receipt_url_auth_successful_key.yaml | 92 ------- ...t_from_url_async.test_receipt_url_jpg.yaml | 92 ------- .../tests/test_receipt_from_url.py | 2 +- .../tests/test_receipt_from_url_async.py | 2 +- 32 files changed, 2 insertions(+), 3569 deletions(-) delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_business_card_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_business_card_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_business_card_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_business_card_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model.test_compose_model_invalid_model.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model_async.test_compose_model_invalid_model.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_url_auth_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_url_auth_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_passing_bad_url.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_pdf.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_invoice_pdf.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_invoice_pdf.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_authentication_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_auth_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_jpg.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_auth_successful_key.yaml delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_jpg.yaml diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_authentication_successful_key.yaml deleted file mode 100644 index 8c9b9b45a0e1..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_authentication_successful_key.yaml +++ /dev/null @@ -1,112 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 915108 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '915108' - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 3bb1ceec-da67-487d-930d-82fbb8d0ef45 - content-length: - - '0' - date: - - Wed, 11 Nov 2020 17:49:36 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/3bb1ceec-da67-487d-930d-82fbb8d0ef45 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '617' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/3bb1ceec-da67-487d-930d-82fbb8d0ef45 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:49:36Z", - "lastUpdatedDateTime": "2020-11-11T17:49:40Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: - - 61b81c52-000b-44bd-a0f6-019cc2e5c298 - content-length: - - '2683' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 11 Nov 2020 17:49:41 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '27' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_business_card_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_business_card_jpg.yaml deleted file mode 100644 index 3bf2124f73b3..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card.test_business_card_jpg.yaml +++ /dev/null @@ -1,112 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 915108 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '915108' - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 599e3f0e-a185-4b3f-b27c-6425f72d9839 - content-length: - - '0' - date: - - Wed, 11 Nov 2020 17:49:58 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/599e3f0e-a185-4b3f-b27c-6425f72d9839 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '554' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/599e3f0e-a185-4b3f-b27c-6425f72d9839 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:49:58Z", - "lastUpdatedDateTime": "2020-11-11T17:50:02Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: - - 7c9d5217-ea76-4b3f-b1b8-05c4912025e1 - content-length: - - '2683' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 11 Nov 2020 17:50:03 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '27' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_authentication_successful_key.yaml deleted file mode 100644 index d5df4ecbb7d6..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_authentication_successful_key.yaml +++ /dev/null @@ -1,88 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 915108 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 67a6dd74-fa25-4ffd-8ca8-77d703e3f61d - content-length: '0' - date: Wed, 11 Nov 2020 17:51:38 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/67a6dd74-fa25-4ffd-8ca8-77d703e3f61d - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '548' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/67a6dd74-fa25-4ffd-8ca8-77d703e3f61d - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:51:39Z", - "lastUpdatedDateTime": "2020-11-11T17:51:41Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: 5a5edc2e-f128-40a9-b9a4-9ebe9e6da718 - content-length: '2683' - content-type: application/json; charset=utf-8 - date: Wed, 11 Nov 2020 17:51:44 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '19' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/67a6dd74-fa25-4ffd-8ca8-77d703e3f61d -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_business_card_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_business_card_jpg.yaml deleted file mode 100644 index ecd77eaee428..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_async.test_business_card_jpg.yaml +++ /dev/null @@ -1,88 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 915108 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: d1e77b87-f8a0-4a6a-9207-1eb58ec90d02 - content-length: '0' - date: Wed, 11 Nov 2020 17:52:04 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/d1e77b87-f8a0-4a6a-9207-1eb58ec90d02 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '552' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/d1e77b87-f8a0-4a6a-9207-1eb58ec90d02 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:52:05Z", - "lastUpdatedDateTime": "2020-11-11T17:52:07Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: ff82861e-4f88-4379-9713-416ceb235afb - content-length: '2683' - content-type: application/json; charset=utf-8 - date: Wed, 11 Nov 2020 17:52:09 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '18' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/d1e77b87-f8a0-4a6a-9207-1eb58ec90d02 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_authentication_successful_key.yaml deleted file mode 100644 index 6b275862c91f..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_authentication_successful_key.yaml +++ /dev/null @@ -1,111 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/business_cards/business-card-english.jpg"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '184' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 1002139f-7f86-4908-90e2-da5e28869080 - content-length: - - '0' - date: - - Wed, 11 Nov 2020 17:53:35 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/1002139f-7f86-4908-90e2-da5e28869080 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '836' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/1002139f-7f86-4908-90e2-da5e28869080 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:53:35Z", - "lastUpdatedDateTime": "2020-11-11T17:53:37Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: - - 7c526c6f-dd31-490d-a4ac-b24658ac670c - content-length: - - '2683' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 11 Nov 2020 17:53:40 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '18' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_business_card_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_business_card_jpg.yaml deleted file mode 100644 index e2b8b62c5048..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url.test_business_card_jpg.yaml +++ /dev/null @@ -1,111 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/business_cards/business-card-english.jpg"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '184' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 47384480-ffd0-48e6-adde-065bbe3e19aa - content-length: - - '0' - date: - - Wed, 11 Nov 2020 17:53:51 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/47384480-ffd0-48e6-adde-065bbe3e19aa - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '833' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/47384480-ffd0-48e6-adde-065bbe3e19aa - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:53:52Z", - "lastUpdatedDateTime": "2020-11-11T17:53:55Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: - - 677e5910-2b03-4ff9-9ee7-a5feb9ccc097 - content-length: - - '2683' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 11 Nov 2020 17:53:56 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '21' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_authentication_successful_key.yaml deleted file mode 100644 index 1b6ea8189e1f..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_authentication_successful_key.yaml +++ /dev/null @@ -1,89 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/business_cards/business-card-english.jpg"}''' - headers: - Accept: - - application/json - Content-Length: - - '184' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 1391f9b7-23fb-43ff-ae95-8951dc8657e3 - content-length: '0' - date: Wed, 11 Nov 2020 17:55:02 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/1391f9b7-23fb-43ff-ae95-8951dc8657e3 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '584' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/1391f9b7-23fb-43ff-ae95-8951dc8657e3 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:55:02Z", - "lastUpdatedDateTime": "2020-11-11T17:55:04Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: 387df0ec-5691-4d76-8385-9657d5d5ee48 - content-length: '2683' - content-type: application/json; charset=utf-8 - date: Wed, 11 Nov 2020 17:55:06 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '16' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/1391f9b7-23fb-43ff-ae95-8951dc8657e3 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_business_card_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_business_card_jpg.yaml deleted file mode 100644 index 6baf215b3dcf..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_business_card_from_url_async.test_business_card_jpg.yaml +++ /dev/null @@ -1,89 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/business_cards/business-card-english.jpg"}''' - headers: - Accept: - - application/json - Content-Length: - - '184' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 3bc41c61-6bae-48f7-92fb-fed1d9b159c7 - content-length: '0' - date: Wed, 11 Nov 2020 17:55:22 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/3bc41c61-6bae-48f7-92fb-fed1d9b159c7 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '509' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/3bc41c61-6bae-48f7-92fb-fed1d9b159c7 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-11T17:55:22Z", - "lastUpdatedDateTime": "2020-11-11T17:55:24Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": -16.6836, "width": 4032, "height": - 3024, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:businesscard", - "pageRange": [1, 1], "fields": {"ContactNames": {"type": "array", "valueArray": - [{"type": "object", "valueObject": {"FirstName": {"type": "string", "valueString": - "Avery", "text": "Avery", "boundingBox": [683, 1098, 1158, 984, 1187, 1103, - 712, 1212], "page": 1}, "LastName": {"type": "string", "valueString": "Smith", - "text": "Smith", "boundingBox": [1179, 979, 1610, 871, 1637, 990, 1209, 1097], - "page": 1}}, "text": "Dr. Avery Smith", "boundingBox": [413.8, 1151.8, 1610, - 871, 1639.5, 996.8, 443.4, 1277.6], "page": 1, "confidence": 0.979}]}, "JobTitles": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Senior - Researcher", "text": "Senior Researcher", "boundingBox": [446.8, 1312.2, 1318, - 1103, 1336.7, 1180.9, 465.5, 1390.1], "page": 1, "confidence": 0.99}]}, "Departments": - {"type": "array", "valueArray": [{"type": "string", "valueString": "Cloud - & Al Department", "text": "Cloud & Al Department", "boundingBox": [473.1, - 1407.2, 1594, 1132, 1615.4, 1219.3, 494.5, 1494.5], "page": 1, "confidence": - 0.989}]}, "Emails": {"type": "array", "valueArray": [{"type": "string", "valueString": - "avery.smith@contoso.com", "text": "avery.smith@contoso.com", "boundingBox": - [2103, 935, 2926, 701, 2938, 764, 2119, 994], "page": 1, "confidence": 0.99}]}, - "Websites": {"type": "array", "valueArray": [{"type": "string", "valueString": - "https://www.contoso.com/", "text": "https://www.contoso.com/", "boundingBox": - [2116, 1004, 2981, 757, 3006, 824, 2136, 1075], "page": 1, "confidence": 0.99}]}, - "MobilePhones": {"type": "array", "valueArray": [{"type": "phoneNumber", "text": - "+44 (0) 7911 123456", "boundingBox": [2431.9, 1037.2, 3081.2, 843.3, 3102.7, - 915.2, 2453.3, 1109.1], "page": 1, "confidence": 0.99}]}, "OtherPhones": {"type": - "array", "valueArray": [{"type": "phoneNumber", "text": "+44 (0) 20 9876 5432", - "boundingBox": [2469.1, 1118.1, 3136.2, 912.4, 3158.8, 985.8, 2491.8, 1191.5], - "page": 1, "confidence": 0.99}]}, "Faxes": {"type": "array", "valueArray": - [{"type": "phoneNumber", "text": "+44 (0) 20 6789 2345", "boundingBox": [2521.3, - 1196.2, 3198, 979, 3222.3, 1054.7, 2545.6, 1271.9], "page": 1, "confidence": - 0.99}]}, "CompanyNames": {"type": "array", "valueArray": [{"type": "string", - "valueString": "Contoso", "text": "Contoso", "boundingBox": [1157, 1923, 2299, - 1565, 2361, 1731, 1213, 2098], "page": 1, "confidence": 0.222}]}, "Addresses": - {"type": "array", "valueArray": [{"type": "string", "valueString": "2 Kingdom - Street Paddington, London, W2 6BD", "text": "2 Kingdom Street Paddington, - London, W2 6BD", "boundingBox": [1224.6, 2139.5, 2536.4, 1685.2, 2613.1, 1906.7, - 1301.3, 2361], "page": 1, "confidence": 0.979}]}}}]}}' - headers: - apim-request-id: 794f68bd-f4a6-4029-a0f7-160b028764e9 - content-length: '2683' - content-type: application/json; charset=utf-8 - date: Wed, 11 Nov 2020 17:55:27 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '21' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/3bc41c61-6bae-48f7-92fb-fed1d9b159c7 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model.test_compose_model_invalid_model.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model.test_compose_model_invalid_model.yaml deleted file mode 100644 index f5f70db11e50..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model.test_compose_model_invalid_model.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: 'b''{"modelIds": ["00000000-0000-0000-0000-000000000000"]}''' - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '54' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/custom/models/compose - response: - body: - string: '{"error": {"code": "1001", "message": "Parameter ''ModelIds'' is either - null or has less than two unique models."}}' - headers: - apim-request-id: - - 4a520ba0-c96a-488e-ab93-a90538a8cc7c - content-type: - - application/json; charset=utf-8 - date: - - Thu, 29 Oct 2020 21:19:43 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '3' - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model_async.test_compose_model_invalid_model.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model_async.test_compose_model_invalid_model.yaml deleted file mode 100644 index e6b438ae4723..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_compose_model_async.test_compose_model_invalid_model.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: 'b''{"modelIds": ["00000000-0000-0000-0000-000000000000"]}''' - headers: - Accept: - - application/json, text/json - Content-Length: - - '54' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/custom/models/compose - response: - body: - string: '{"error": {"code": "1001", "message": "Parameter ''ModelIds'' is either - null or has less than two unique models."}}' - headers: - apim-request-id: 2bf6cd37-d746-4c39-bd80-9eade46d85cf - content-type: application/json; charset=utf-8 - date: Thu, 29 Oct 2020 21:21:11 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - transfer-encoding: chunked - x-content-type-options: nosniff - x-envoy-upstream-service-time: '3' - status: - code: 400 - message: Bad Request - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/custom/models/compose -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_authentication_successful_key.yaml deleted file mode 100644 index 577e8bb4dc65..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content.test_content_authentication_successful_key.yaml +++ /dev/null @@ -1,198 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 147362 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '147362' - Content-Type: - - application/pdf - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyze - response: - body: - string: '' - headers: - apim-request-id: - - 15959b4b-29db-4c3d-a4b5-b397fc8ad09b - content-length: - - '0' - date: - - Thu, 29 Oct 2020 23:32:01 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/15959b4b-29db-4c3d-a4b5-b397fc8ad09b - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '119' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/15959b4b-29db-4c3d-a4b5-b397fc8ad09b - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-29T23:32:02Z", - "lastUpdatedDateTime": "2020-10-29T23:32:07Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch", "lines": [{"boundingBox": [0.5384, 1.1583, 1.4466, 1.1583, - 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [0.5384, 1.1583, - 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "confidence": - 1}]}, {"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, - 1.6154], "text": "Address:", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, - 0.7994, 1.6154], "text": "Address:", "confidence": 1}]}, {"boundingBox": [4.4033, - 1.5114, 5.8155, 1.5114, 5.8155, 1.6155, 4.4033, 1.6155], "text": "Invoice - For: Microsoft", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [4.4033, 1.5143, 4.8234, 1.5143, 4.8234, 1.6155, - 4.4033, 1.6155], "text": "Invoice", "confidence": 1}, {"boundingBox": [4.8793, - 1.5143, 5.1013, 1.5143, 5.1013, 1.6154, 4.8793, 1.6154], "text": "For:", "confidence": - 1}, {"boundingBox": [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, - 1.6151], "text": "Microsoft", "confidence": 1}]}, {"boundingBox": [0.8106, - 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, 0.8106, 1.8342], "text": "1 Redmond - way Suite", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.8106, 1.708, 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053], - "text": "1", "confidence": 1}, {"boundingBox": [0.923, 1.7047, 1.5018, 1.7047, - 1.5018, 1.8068, 0.923, 1.8068], "text": "Redmond", "confidence": 1}, {"boundingBox": - [1.5506, 1.7309, 1.7949, 1.7309, 1.7949, 1.8342, 1.5506, 1.8342], "text": - "way", "confidence": 1}, {"boundingBox": [1.8415, 1.7033, 2.1445, 1.7033, - 2.1445, 1.8078, 1.8415, 1.8078], "text": "Suite", "confidence": 1}]}, {"boundingBox": - [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459], "text": "1020 - Enterprise Way", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, 5.2036, - 1.8185], "text": "1020", "confidence": 1}, {"boundingBox": [5.5488, 1.7164, - 6.2178, 1.7164, 6.2178, 1.8441, 5.5488, 1.8441], "text": "Enterprise", "confidence": - 1}, {"boundingBox": [6.2618, 1.7164, 6.5436, 1.7164, 6.5436, 1.8459, 6.2618, - 1.8459], "text": "Way", "confidence": 1}]}, {"boundingBox": [0.8019, 1.896, - 2.0384, 1.896, 2.0384, 2.0171, 0.8019, 2.0171], "text": "6000 Redmond, WA", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [0.8019, 1.896, 1.0991, 1.896, 1.0991, 1.9994, 0.8019, 1.9994], "text": "6000", - "confidence": 1}, {"boundingBox": [1.1537, 1.8964, 1.7689, 1.8964, 1.7689, - 2.0171, 1.1537, 2.0171], "text": "Redmond,", "confidence": 1}, {"boundingBox": - [1.8196, 1.8976, 2.0384, 1.8976, 2.0384, 1.9969, 1.8196, 1.9969], "text": - "WA", "confidence": 1}]}, {"boundingBox": [5.196, 1.9047, 6.6526, 1.9047, - 6.6526, 2.0359, 5.196, 2.0359], "text": "Sunnayvale, CA 87659", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [5.196, - 1.9047, 5.9894, 1.9047, 5.9894, 2.0359, 5.196, 2.0359], "text": "Sunnayvale,", - "confidence": 1}, {"boundingBox": [6.0427, 1.9047, 6.2354, 1.9047, 6.2354, - 2.0085, 6.0427, 2.0085], "text": "CA", "confidence": 1}, {"boundingBox": [6.2801, - 1.906, 6.6526, 1.906, 6.6526, 2.0086, 6.2801, 2.0086], "text": "87659", "confidence": - 1}]}, {"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, - 2.1911], "text": "99243", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, - 0.8025, 2.1911], "text": "99243", "confidence": 1}]}, {"boundingBox": [0.5439, - 2.8733, 1.5729, 2.8733, 1.5729, 2.9754, 0.5439, 2.9754], "text": "Invoice - Number", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.5439, 2.8733, 1.0098, 2.8733, 1.0098, 2.9754, 0.5439, - 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": [1.0611, 2.8743, - 1.5729, 2.8743, 1.5729, 2.9754, 1.0611, 2.9754], "text": "Number", "confidence": - 1}]}, {"boundingBox": [1.9491, 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, - 2.9754], "text": "Invoice Date", "appearance": {"style": {"name": "other", - "confidence": 1}}, "words": [{"boundingBox": [1.9491, 2.8733, 2.415, 2.8733, - 2.415, 2.9754, 1.9491, 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": - [2.4673, 2.8743, 2.7527, 2.8743, 2.7527, 2.9754, 2.4673, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [3.3495, 2.8733, 4.4547, 2.8733, - 4.4547, 2.9754, 3.3495, 2.9754], "text": "Invoice Due Date", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [3.3495, - 2.8733, 3.8155, 2.8733, 3.8155, 2.9754, 3.3495, 2.9754], "text": "Invoice", - "confidence": 1}, {"boundingBox": [3.8677, 2.8743, 4.1149, 2.8743, 4.1149, - 2.9754, 3.8677, 2.9754], "text": "Due", "confidence": 1}, {"boundingBox": - [4.1678, 2.8743, 4.4547, 2.8743, 4.4547, 2.9754, 4.1678, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [4.7468, 2.8717, 5.289, 2.8717, - 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [4.7468, 2.8717, - 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "confidence": - 1}]}, {"boundingBox": [6.141, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.141, - 2.9736], "text": "VAT ID", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [6.141, 2.873, 6.4147, 2.873, 6.4147, 2.9736, - 6.141, 2.9736], "text": "VAT", "confidence": 1}, {"boundingBox": [6.4655, - 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.4655, 2.9736], "text": "ID", "confidence": - 1}]}, {"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, - 3.5144], "text": "34278587", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, - 0.5397, 3.5144], "text": "34278587", "confidence": 1}]}, {"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "confidence": - 1}]}, {"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144], - "text": "6/24/2017", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, - 3.346, 3.5144], "text": "6/24/2017", "confidence": 1}]}, {"boundingBox": [5.3871, - 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": "$56,651.49", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": - "$56,651.49", "confidence": 1}]}, {"boundingBox": [6.2285, 3.4114, 6.3919, - 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [6.2285, 3.4114, - 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "confidence": - 1}]}]}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, - "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311], "elements": - ["#/readResults/0/lines/8/words/0", "#/readResults/0/lines/8/words/1"]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311], "elements": ["#/readResults/0/lines/9/words/0", - "#/readResults/0/lines/9/words/1"]}, {"rowIndex": 0, "columnIndex": 2, "text": - "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, 4.7094, 3.311, - 3.3036, 3.311], "elements": ["#/readResults/0/lines/10/words/0", "#/readResults/0/lines/10/words/1", - "#/readResults/0/lines/10/words/2"]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311], "elements": ["#/readResults/0/lines/11/words/0"]}, - {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", "boundingBox": [6.1079, - 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311], "elements": ["#/readResults/0/lines/12/words/0", - "#/readResults/0/lines/12/words/1"]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": - 2, "text": "34278587", "boundingBox": [0.5136, 3.311, 1.8978, 3.311, 1.8978, - 3.8534, 0.5136, 3.8534], "elements": ["#/readResults/0/lines/13/words/0"]}, - {"rowIndex": 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": - [1.8978, 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534], "elements": - ["#/readResults/0/lines/14/words/0"]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": - 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, 3.311, 4.7165, - 3.8534, 3.3036, 3.8534], "elements": ["#/readResults/0/lines/15/words/0"]}, - {"rowIndex": 1, "columnIndex": 3, "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", - "boundingBox": [4.7094, 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534], - "elements": ["#/readResults/0/lines/16/words/0"]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393], "elements": ["#/readResults/0/lines/17/words/0"]}, {"rowIndex": - 2, "columnIndex": 5, "text": "", "boundingBox": [6.1079, 3.6393, 7.4922, 3.6393, - 7.4922, 3.8534, 6.1079, 3.8534], "elements": []}], "boundingBox": [0.4985, - 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}]}}' - headers: - apim-request-id: - - fd9d8fc0-9be9-48fb-a75c-28328d6d60b9 - content-length: - - '8802' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 29 Oct 2020 23:32:07 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '21' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_authentication_successful_key.yaml deleted file mode 100644 index 8e6672d2bf77..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_async.test_content_authentication_successful_key.yaml +++ /dev/null @@ -1,197 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 147362 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - application/pdf - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyze - response: - body: - string: '' - headers: - apim-request-id: 839824d9-b066-419e-8f4c-5fec3418cc4a - content-length: '0' - date: Thu, 29 Oct 2020 23:58:19 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/839824d9-b066-419e-8f4c-5fec3418cc4a - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '95' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/layout/analyze -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/839824d9-b066-419e-8f4c-5fec3418cc4a - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-29T23:58:19Z", "lastUpdatedDateTime": - "2020-10-29T23:58:24Z"}' - headers: - apim-request-id: e02161e3-4522-4e5f-87ef-5f05bed11697 - content-length: '106' - content-type: application/json; charset=utf-8 - date: Thu, 29 Oct 2020 23:58:24 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '12' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/839824d9-b066-419e-8f4c-5fec3418cc4a -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/839824d9-b066-419e-8f4c-5fec3418cc4a - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-29T23:58:19Z", - "lastUpdatedDateTime": "2020-10-29T23:58:24Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch", "lines": [{"boundingBox": [0.5384, 1.1583, 1.4466, 1.1583, - 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [0.5384, 1.1583, - 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "confidence": - 1}]}, {"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, - 1.6154], "text": "Address:", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, - 0.7994, 1.6154], "text": "Address:", "confidence": 1}]}, {"boundingBox": [4.4033, - 1.5114, 5.8155, 1.5114, 5.8155, 1.6155, 4.4033, 1.6155], "text": "Invoice - For: Microsoft", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [4.4033, 1.5143, 4.8234, 1.5143, 4.8234, 1.6155, - 4.4033, 1.6155], "text": "Invoice", "confidence": 1}, {"boundingBox": [4.8793, - 1.5143, 5.1013, 1.5143, 5.1013, 1.6154, 4.8793, 1.6154], "text": "For:", "confidence": - 1}, {"boundingBox": [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, - 1.6151], "text": "Microsoft", "confidence": 1}]}, {"boundingBox": [0.8106, - 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, 0.8106, 1.8342], "text": "1 Redmond - way Suite", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.8106, 1.708, 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053], - "text": "1", "confidence": 1}, {"boundingBox": [0.923, 1.7047, 1.5018, 1.7047, - 1.5018, 1.8068, 0.923, 1.8068], "text": "Redmond", "confidence": 1}, {"boundingBox": - [1.5506, 1.7309, 1.7949, 1.7309, 1.7949, 1.8342, 1.5506, 1.8342], "text": - "way", "confidence": 1}, {"boundingBox": [1.8415, 1.7033, 2.1445, 1.7033, - 2.1445, 1.8078, 1.8415, 1.8078], "text": "Suite", "confidence": 1}]}, {"boundingBox": - [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459], "text": "1020 - Enterprise Way", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, 5.2036, - 1.8185], "text": "1020", "confidence": 1}, {"boundingBox": [5.5488, 1.7164, - 6.2178, 1.7164, 6.2178, 1.8441, 5.5488, 1.8441], "text": "Enterprise", "confidence": - 1}, {"boundingBox": [6.2618, 1.7164, 6.5436, 1.7164, 6.5436, 1.8459, 6.2618, - 1.8459], "text": "Way", "confidence": 1}]}, {"boundingBox": [0.8019, 1.896, - 2.0384, 1.896, 2.0384, 2.0171, 0.8019, 2.0171], "text": "6000 Redmond, WA", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [0.8019, 1.896, 1.0991, 1.896, 1.0991, 1.9994, 0.8019, 1.9994], "text": "6000", - "confidence": 1}, {"boundingBox": [1.1537, 1.8964, 1.7689, 1.8964, 1.7689, - 2.0171, 1.1537, 2.0171], "text": "Redmond,", "confidence": 1}, {"boundingBox": - [1.8196, 1.8976, 2.0384, 1.8976, 2.0384, 1.9969, 1.8196, 1.9969], "text": - "WA", "confidence": 1}]}, {"boundingBox": [5.196, 1.9047, 6.6526, 1.9047, - 6.6526, 2.0359, 5.196, 2.0359], "text": "Sunnayvale, CA 87659", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [5.196, - 1.9047, 5.9894, 1.9047, 5.9894, 2.0359, 5.196, 2.0359], "text": "Sunnayvale,", - "confidence": 1}, {"boundingBox": [6.0427, 1.9047, 6.2354, 1.9047, 6.2354, - 2.0085, 6.0427, 2.0085], "text": "CA", "confidence": 1}, {"boundingBox": [6.2801, - 1.906, 6.6526, 1.906, 6.6526, 2.0086, 6.2801, 2.0086], "text": "87659", "confidence": - 1}]}, {"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, - 2.1911], "text": "99243", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, - 0.8025, 2.1911], "text": "99243", "confidence": 1}]}, {"boundingBox": [0.5439, - 2.8733, 1.5729, 2.8733, 1.5729, 2.9754, 0.5439, 2.9754], "text": "Invoice - Number", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.5439, 2.8733, 1.0098, 2.8733, 1.0098, 2.9754, 0.5439, - 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": [1.0611, 2.8743, - 1.5729, 2.8743, 1.5729, 2.9754, 1.0611, 2.9754], "text": "Number", "confidence": - 1}]}, {"boundingBox": [1.9491, 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, - 2.9754], "text": "Invoice Date", "appearance": {"style": {"name": "other", - "confidence": 1}}, "words": [{"boundingBox": [1.9491, 2.8733, 2.415, 2.8733, - 2.415, 2.9754, 1.9491, 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": - [2.4673, 2.8743, 2.7527, 2.8743, 2.7527, 2.9754, 2.4673, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [3.3495, 2.8733, 4.4547, 2.8733, - 4.4547, 2.9754, 3.3495, 2.9754], "text": "Invoice Due Date", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [3.3495, - 2.8733, 3.8155, 2.8733, 3.8155, 2.9754, 3.3495, 2.9754], "text": "Invoice", - "confidence": 1}, {"boundingBox": [3.8677, 2.8743, 4.1149, 2.8743, 4.1149, - 2.9754, 3.8677, 2.9754], "text": "Due", "confidence": 1}, {"boundingBox": - [4.1678, 2.8743, 4.4547, 2.8743, 4.4547, 2.9754, 4.1678, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [4.7468, 2.8717, 5.289, 2.8717, - 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [4.7468, 2.8717, - 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "confidence": - 1}]}, {"boundingBox": [6.141, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.141, - 2.9736], "text": "VAT ID", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [6.141, 2.873, 6.4147, 2.873, 6.4147, 2.9736, - 6.141, 2.9736], "text": "VAT", "confidence": 1}, {"boundingBox": [6.4655, - 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.4655, 2.9736], "text": "ID", "confidence": - 1}]}, {"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, - 3.5144], "text": "34278587", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, - 0.5397, 3.5144], "text": "34278587", "confidence": 1}]}, {"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "confidence": - 1}]}, {"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144], - "text": "6/24/2017", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, - 3.346, 3.5144], "text": "6/24/2017", "confidence": 1}]}, {"boundingBox": [5.3871, - 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": "$56,651.49", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": - "$56,651.49", "confidence": 1}]}, {"boundingBox": [6.2285, 3.4114, 6.3919, - 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [6.2285, 3.4114, - 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "confidence": - 1}]}]}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, - "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311], "elements": - ["#/readResults/0/lines/8/words/0", "#/readResults/0/lines/8/words/1"]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311], "elements": ["#/readResults/0/lines/9/words/0", - "#/readResults/0/lines/9/words/1"]}, {"rowIndex": 0, "columnIndex": 2, "text": - "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, 4.7094, 3.311, - 3.3036, 3.311], "elements": ["#/readResults/0/lines/10/words/0", "#/readResults/0/lines/10/words/1", - "#/readResults/0/lines/10/words/2"]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311], "elements": ["#/readResults/0/lines/11/words/0"]}, - {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", "boundingBox": [6.1079, - 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311], "elements": ["#/readResults/0/lines/12/words/0", - "#/readResults/0/lines/12/words/1"]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": - 2, "text": "34278587", "boundingBox": [0.5136, 3.311, 1.8978, 3.311, 1.8978, - 3.8534, 0.5136, 3.8534], "elements": ["#/readResults/0/lines/13/words/0"]}, - {"rowIndex": 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": - [1.8978, 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534], "elements": - ["#/readResults/0/lines/14/words/0"]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": - 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, 3.311, 4.7165, - 3.8534, 3.3036, 3.8534], "elements": ["#/readResults/0/lines/15/words/0"]}, - {"rowIndex": 1, "columnIndex": 3, "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", - "boundingBox": [4.7094, 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534], - "elements": ["#/readResults/0/lines/16/words/0"]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393], "elements": ["#/readResults/0/lines/17/words/0"]}, {"rowIndex": - 2, "columnIndex": 5, "text": "", "boundingBox": [6.1079, 3.6393, 7.4922, 3.6393, - 7.4922, 3.8534, 6.1079, 3.8534], "elements": []}], "boundingBox": [0.4985, - 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}]}}' - headers: - apim-request-id: 3c417ed8-c871-492c-866a-1e5020b9be7f - content-length: '8802' - content-type: application/json; charset=utf-8 - date: Thu, 29 Oct 2020 23:58:29 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '22' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/839824d9-b066-419e-8f4c-5fec3418cc4a -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_url_auth_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_url_auth_successful_key.yaml deleted file mode 100644 index acb540d017cf..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url.test_content_url_auth_successful_key.yaml +++ /dev/null @@ -1,232 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyze - response: - body: - string: '' - headers: - apim-request-id: - - 39cead77-73b1-45f7-85d3-3b1abdcddcb6 - content-length: - - '0' - date: - - Fri, 30 Oct 2020 00:06:45 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/39cead77-73b1-45f7-85d3-3b1abdcddcb6 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '66' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/39cead77-73b1-45f7-85d3-3b1abdcddcb6 - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T00:06:45Z", "lastUpdatedDateTime": - "2020-10-30T00:06:45Z"}' - headers: - apim-request-id: - - 9e70077b-0c6b-49bf-b261-b1ebc8c337d6 - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 00:06:49 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '10' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/39cead77-73b1-45f7-85d3-3b1abdcddcb6 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T00:06:45Z", - "lastUpdatedDateTime": "2020-10-30T00:06:50Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch", "lines": [{"boundingBox": [0.5384, 1.1583, 1.4466, 1.1583, - 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [0.5384, 1.1583, - 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "confidence": - 1}]}, {"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, - 1.6154], "text": "Address:", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, - 0.7994, 1.6154], "text": "Address:", "confidence": 1}]}, {"boundingBox": [4.4033, - 1.5114, 5.8155, 1.5114, 5.8155, 1.6155, 4.4033, 1.6155], "text": "Invoice - For: Microsoft", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [4.4033, 1.5143, 4.8234, 1.5143, 4.8234, 1.6155, - 4.4033, 1.6155], "text": "Invoice", "confidence": 1}, {"boundingBox": [4.8793, - 1.5143, 5.1013, 1.5143, 5.1013, 1.6154, 4.8793, 1.6154], "text": "For:", "confidence": - 1}, {"boundingBox": [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, - 1.6151], "text": "Microsoft", "confidence": 1}]}, {"boundingBox": [0.8106, - 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, 0.8106, 1.8342], "text": "1 Redmond - way Suite", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.8106, 1.708, 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053], - "text": "1", "confidence": 1}, {"boundingBox": [0.923, 1.7047, 1.5018, 1.7047, - 1.5018, 1.8068, 0.923, 1.8068], "text": "Redmond", "confidence": 1}, {"boundingBox": - [1.5506, 1.7309, 1.7949, 1.7309, 1.7949, 1.8342, 1.5506, 1.8342], "text": - "way", "confidence": 1}, {"boundingBox": [1.8415, 1.7033, 2.1445, 1.7033, - 2.1445, 1.8078, 1.8415, 1.8078], "text": "Suite", "confidence": 1}]}, {"boundingBox": - [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459], "text": "1020 - Enterprise Way", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, 5.2036, - 1.8185], "text": "1020", "confidence": 1}, {"boundingBox": [5.5488, 1.7164, - 6.2178, 1.7164, 6.2178, 1.8441, 5.5488, 1.8441], "text": "Enterprise", "confidence": - 1}, {"boundingBox": [6.2618, 1.7164, 6.5436, 1.7164, 6.5436, 1.8459, 6.2618, - 1.8459], "text": "Way", "confidence": 1}]}, {"boundingBox": [0.8019, 1.896, - 2.0384, 1.896, 2.0384, 2.0171, 0.8019, 2.0171], "text": "6000 Redmond, WA", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [0.8019, 1.896, 1.0991, 1.896, 1.0991, 1.9994, 0.8019, 1.9994], "text": "6000", - "confidence": 1}, {"boundingBox": [1.1537, 1.8964, 1.7689, 1.8964, 1.7689, - 2.0171, 1.1537, 2.0171], "text": "Redmond,", "confidence": 1}, {"boundingBox": - [1.8196, 1.8976, 2.0384, 1.8976, 2.0384, 1.9969, 1.8196, 1.9969], "text": - "WA", "confidence": 1}]}, {"boundingBox": [5.196, 1.9047, 6.6526, 1.9047, - 6.6526, 2.0359, 5.196, 2.0359], "text": "Sunnayvale, CA 87659", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [5.196, - 1.9047, 5.9894, 1.9047, 5.9894, 2.0359, 5.196, 2.0359], "text": "Sunnayvale,", - "confidence": 1}, {"boundingBox": [6.0427, 1.9047, 6.2354, 1.9047, 6.2354, - 2.0085, 6.0427, 2.0085], "text": "CA", "confidence": 1}, {"boundingBox": [6.2801, - 1.906, 6.6526, 1.906, 6.6526, 2.0086, 6.2801, 2.0086], "text": "87659", "confidence": - 1}]}, {"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, - 2.1911], "text": "99243", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, - 0.8025, 2.1911], "text": "99243", "confidence": 1}]}, {"boundingBox": [0.5439, - 2.8733, 1.5729, 2.8733, 1.5729, 2.9754, 0.5439, 2.9754], "text": "Invoice - Number", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.5439, 2.8733, 1.0098, 2.8733, 1.0098, 2.9754, 0.5439, - 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": [1.0611, 2.8743, - 1.5729, 2.8743, 1.5729, 2.9754, 1.0611, 2.9754], "text": "Number", "confidence": - 1}]}, {"boundingBox": [1.9491, 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, - 2.9754], "text": "Invoice Date", "appearance": {"style": {"name": "other", - "confidence": 1}}, "words": [{"boundingBox": [1.9491, 2.8733, 2.415, 2.8733, - 2.415, 2.9754, 1.9491, 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": - [2.4673, 2.8743, 2.7527, 2.8743, 2.7527, 2.9754, 2.4673, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [3.3495, 2.8733, 4.4547, 2.8733, - 4.4547, 2.9754, 3.3495, 2.9754], "text": "Invoice Due Date", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [3.3495, - 2.8733, 3.8155, 2.8733, 3.8155, 2.9754, 3.3495, 2.9754], "text": "Invoice", - "confidence": 1}, {"boundingBox": [3.8677, 2.8743, 4.1149, 2.8743, 4.1149, - 2.9754, 3.8677, 2.9754], "text": "Due", "confidence": 1}, {"boundingBox": - [4.1678, 2.8743, 4.4547, 2.8743, 4.4547, 2.9754, 4.1678, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [4.7468, 2.8717, 5.289, 2.8717, - 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [4.7468, 2.8717, - 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "confidence": - 1}]}, {"boundingBox": [6.141, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.141, - 2.9736], "text": "VAT ID", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [6.141, 2.873, 6.4147, 2.873, 6.4147, 2.9736, - 6.141, 2.9736], "text": "VAT", "confidence": 1}, {"boundingBox": [6.4655, - 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.4655, 2.9736], "text": "ID", "confidence": - 1}]}, {"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, - 3.5144], "text": "34278587", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, - 0.5397, 3.5144], "text": "34278587", "confidence": 1}]}, {"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "confidence": - 1}]}, {"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144], - "text": "6/24/2017", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, - 3.346, 3.5144], "text": "6/24/2017", "confidence": 1}]}, {"boundingBox": [5.3871, - 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": "$56,651.49", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": - "$56,651.49", "confidence": 1}]}, {"boundingBox": [6.2285, 3.4114, 6.3919, - 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [6.2285, 3.4114, - 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "confidence": - 1}]}]}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, - "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311], "elements": - ["#/readResults/0/lines/8/words/0", "#/readResults/0/lines/8/words/1"]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311], "elements": ["#/readResults/0/lines/9/words/0", - "#/readResults/0/lines/9/words/1"]}, {"rowIndex": 0, "columnIndex": 2, "text": - "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, 4.7094, 3.311, - 3.3036, 3.311], "elements": ["#/readResults/0/lines/10/words/0", "#/readResults/0/lines/10/words/1", - "#/readResults/0/lines/10/words/2"]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311], "elements": ["#/readResults/0/lines/11/words/0"]}, - {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", "boundingBox": [6.1079, - 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311], "elements": ["#/readResults/0/lines/12/words/0", - "#/readResults/0/lines/12/words/1"]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": - 2, "text": "34278587", "boundingBox": [0.5136, 3.311, 1.8978, 3.311, 1.8978, - 3.8534, 0.5136, 3.8534], "elements": ["#/readResults/0/lines/13/words/0"]}, - {"rowIndex": 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": - [1.8978, 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534], "elements": - ["#/readResults/0/lines/14/words/0"]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": - 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, 3.311, 4.7165, - 3.8534, 3.3036, 3.8534], "elements": ["#/readResults/0/lines/15/words/0"]}, - {"rowIndex": 1, "columnIndex": 3, "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", - "boundingBox": [4.7094, 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534], - "elements": ["#/readResults/0/lines/16/words/0"]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393], "elements": ["#/readResults/0/lines/17/words/0"]}, {"rowIndex": - 2, "columnIndex": 5, "text": "", "boundingBox": [6.1079, 3.6393, 7.4922, 3.6393, - 7.4922, 3.8534, 6.1079, 3.8534], "elements": []}], "boundingBox": [0.4985, - 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}]}}' - headers: - apim-request-id: - - 6fb499ba-e7d3-4de5-8348-7c1410deb4b1 - content-length: - - '8802' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 00:06:54 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '23' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_url_auth_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_url_auth_successful_key.yaml deleted file mode 100644 index c386ae56392d..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_content_from_url_async.test_content_url_auth_successful_key.yaml +++ /dev/null @@ -1,198 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyze - response: - body: - string: '' - headers: - apim-request-id: 66d55ba2-f257-403c-b375-331680b35ca1 - content-length: '0' - date: Fri, 30 Oct 2020 00:07:03 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/66d55ba2-f257-403c-b375-331680b35ca1 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '268' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/layout/analyze -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/66d55ba2-f257-403c-b375-331680b35ca1 - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T00:07:04Z", "lastUpdatedDateTime": - "2020-10-30T00:07:04Z"}' - headers: - apim-request-id: 72517284-f340-44dd-a51a-ecdf873901a0 - content-length: '106' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 00:07:08 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '12' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/66d55ba2-f257-403c-b375-331680b35ca1 -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/66d55ba2-f257-403c-b375-331680b35ca1 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T00:07:04Z", - "lastUpdatedDateTime": "2020-10-30T00:07:11Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch", "lines": [{"boundingBox": [0.5384, 1.1583, 1.4466, 1.1583, - 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [0.5384, 1.1583, - 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "text": "Contoso", "confidence": - 1}]}, {"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, - 1.6154], "text": "Address:", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, - 0.7994, 1.6154], "text": "Address:", "confidence": 1}]}, {"boundingBox": [4.4033, - 1.5114, 5.8155, 1.5114, 5.8155, 1.6155, 4.4033, 1.6155], "text": "Invoice - For: Microsoft", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [4.4033, 1.5143, 4.8234, 1.5143, 4.8234, 1.6155, - 4.4033, 1.6155], "text": "Invoice", "confidence": 1}, {"boundingBox": [4.8793, - 1.5143, 5.1013, 1.5143, 5.1013, 1.6154, 4.8793, 1.6154], "text": "For:", "confidence": - 1}, {"boundingBox": [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, - 1.6151], "text": "Microsoft", "confidence": 1}]}, {"boundingBox": [0.8106, - 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, 0.8106, 1.8342], "text": "1 Redmond - way Suite", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.8106, 1.708, 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053], - "text": "1", "confidence": 1}, {"boundingBox": [0.923, 1.7047, 1.5018, 1.7047, - 1.5018, 1.8068, 0.923, 1.8068], "text": "Redmond", "confidence": 1}, {"boundingBox": - [1.5506, 1.7309, 1.7949, 1.7309, 1.7949, 1.8342, 1.5506, 1.8342], "text": - "way", "confidence": 1}, {"boundingBox": [1.8415, 1.7033, 2.1445, 1.7033, - 2.1445, 1.8078, 1.8415, 1.8078], "text": "Suite", "confidence": 1}]}, {"boundingBox": - [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459], "text": "1020 - Enterprise Way", "appearance": {"style": {"name": "other", "confidence": 1}}, - "words": [{"boundingBox": [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, 5.2036, - 1.8185], "text": "1020", "confidence": 1}, {"boundingBox": [5.5488, 1.7164, - 6.2178, 1.7164, 6.2178, 1.8441, 5.5488, 1.8441], "text": "Enterprise", "confidence": - 1}, {"boundingBox": [6.2618, 1.7164, 6.5436, 1.7164, 6.5436, 1.8459, 6.2618, - 1.8459], "text": "Way", "confidence": 1}]}, {"boundingBox": [0.8019, 1.896, - 2.0384, 1.896, 2.0384, 2.0171, 0.8019, 2.0171], "text": "6000 Redmond, WA", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [0.8019, 1.896, 1.0991, 1.896, 1.0991, 1.9994, 0.8019, 1.9994], "text": "6000", - "confidence": 1}, {"boundingBox": [1.1537, 1.8964, 1.7689, 1.8964, 1.7689, - 2.0171, 1.1537, 2.0171], "text": "Redmond,", "confidence": 1}, {"boundingBox": - [1.8196, 1.8976, 2.0384, 1.8976, 2.0384, 1.9969, 1.8196, 1.9969], "text": - "WA", "confidence": 1}]}, {"boundingBox": [5.196, 1.9047, 6.6526, 1.9047, - 6.6526, 2.0359, 5.196, 2.0359], "text": "Sunnayvale, CA 87659", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [5.196, - 1.9047, 5.9894, 1.9047, 5.9894, 2.0359, 5.196, 2.0359], "text": "Sunnayvale,", - "confidence": 1}, {"boundingBox": [6.0427, 1.9047, 6.2354, 1.9047, 6.2354, - 2.0085, 6.0427, 2.0085], "text": "CA", "confidence": 1}, {"boundingBox": [6.2801, - 1.906, 6.6526, 1.906, 6.6526, 2.0086, 6.2801, 2.0086], "text": "87659", "confidence": - 1}]}, {"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, - 2.1911], "text": "99243", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, - 0.8025, 2.1911], "text": "99243", "confidence": 1}]}, {"boundingBox": [0.5439, - 2.8733, 1.5729, 2.8733, 1.5729, 2.9754, 0.5439, 2.9754], "text": "Invoice - Number", "appearance": {"style": {"name": "other", "confidence": 1}}, "words": - [{"boundingBox": [0.5439, 2.8733, 1.0098, 2.8733, 1.0098, 2.9754, 0.5439, - 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": [1.0611, 2.8743, - 1.5729, 2.8743, 1.5729, 2.9754, 1.0611, 2.9754], "text": "Number", "confidence": - 1}]}, {"boundingBox": [1.9491, 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, - 2.9754], "text": "Invoice Date", "appearance": {"style": {"name": "other", - "confidence": 1}}, "words": [{"boundingBox": [1.9491, 2.8733, 2.415, 2.8733, - 2.415, 2.9754, 1.9491, 2.9754], "text": "Invoice", "confidence": 1}, {"boundingBox": - [2.4673, 2.8743, 2.7527, 2.8743, 2.7527, 2.9754, 2.4673, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [3.3495, 2.8733, 4.4547, 2.8733, - 4.4547, 2.9754, 3.3495, 2.9754], "text": "Invoice Due Date", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [3.3495, - 2.8733, 3.8155, 2.8733, 3.8155, 2.9754, 3.3495, 2.9754], "text": "Invoice", - "confidence": 1}, {"boundingBox": [3.8677, 2.8743, 4.1149, 2.8743, 4.1149, - 2.9754, 3.8677, 2.9754], "text": "Due", "confidence": 1}, {"boundingBox": - [4.1678, 2.8743, 4.4547, 2.8743, 4.4547, 2.9754, 4.1678, 2.9754], "text": - "Date", "confidence": 1}]}, {"boundingBox": [4.7468, 2.8717, 5.289, 2.8717, - 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [4.7468, 2.8717, - 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "text": "Charges", "confidence": - 1}]}, {"boundingBox": [6.141, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.141, - 2.9736], "text": "VAT ID", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [6.141, 2.873, 6.4147, 2.873, 6.4147, 2.9736, - 6.141, 2.9736], "text": "VAT", "confidence": 1}, {"boundingBox": [6.4655, - 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.4655, 2.9736], "text": "ID", "confidence": - 1}]}, {"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, - 3.5144], "text": "34278587", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, - 0.5397, 3.5144], "text": "34278587", "confidence": 1}]}, {"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "appearance": - {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [1.9455, - 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "text": "6/18/2017", "confidence": - 1}]}, {"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144], - "text": "6/24/2017", "appearance": {"style": {"name": "other", "confidence": - 1}}, "words": [{"boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, - 3.346, 3.5144], "text": "6/24/2017", "confidence": 1}]}, {"boundingBox": [5.3871, - 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": "$56,651.49", - "appearance": {"style": {"name": "other", "confidence": 1}}, "words": [{"boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "text": - "$56,651.49", "confidence": 1}]}, {"boundingBox": [6.2285, 3.4114, 6.3919, - 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "appearance": {"style": - {"name": "other", "confidence": 1}}, "words": [{"boundingBox": [6.2285, 3.4114, - 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "text": "PT", "confidence": - 1}]}]}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": 6, - "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311], "elements": - ["#/readResults/0/lines/8/words/0", "#/readResults/0/lines/8/words/1"]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311], "elements": ["#/readResults/0/lines/9/words/0", - "#/readResults/0/lines/9/words/1"]}, {"rowIndex": 0, "columnIndex": 2, "text": - "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, 4.7094, 3.311, - 3.3036, 3.311], "elements": ["#/readResults/0/lines/10/words/0", "#/readResults/0/lines/10/words/1", - "#/readResults/0/lines/10/words/2"]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311], "elements": ["#/readResults/0/lines/11/words/0"]}, - {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", "boundingBox": [6.1079, - 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311], "elements": ["#/readResults/0/lines/12/words/0", - "#/readResults/0/lines/12/words/1"]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": - 2, "text": "34278587", "boundingBox": [0.5136, 3.311, 1.8978, 3.311, 1.8978, - 3.8534, 0.5136, 3.8534], "elements": ["#/readResults/0/lines/13/words/0"]}, - {"rowIndex": 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": - [1.8978, 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534], "elements": - ["#/readResults/0/lines/14/words/0"]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": - 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, 3.311, 4.7165, - 3.8534, 3.3036, 3.8534], "elements": ["#/readResults/0/lines/15/words/0"]}, - {"rowIndex": 1, "columnIndex": 3, "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", - "boundingBox": [4.7094, 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534], - "elements": ["#/readResults/0/lines/16/words/0"]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393], "elements": ["#/readResults/0/lines/17/words/0"]}, {"rowIndex": - 2, "columnIndex": 5, "text": "", "boundingBox": [6.1079, 3.6393, 7.4922, 3.6393, - 7.4922, 3.8534, 6.1079, 3.8534], "elements": []}], "boundingBox": [0.4985, - 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}]}}' - headers: - apim-request-id: deccc041-add2-4ff4-859f-bbf35b36f920 - content-length: '8802' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 00:07:14 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '20' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/layout/analyzeResults/66d55ba2-f257-403c-b375-331680b35ca1 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_passing_bad_url.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_passing_bad_url.yaml deleted file mode 100644 index 6c4c654e4a39..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_passing_bad_url.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://badurl.jpg"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '32' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/custom/models/xx/analyze?includeTextDetails=false - response: - body: - string: '{"error": {"code": "1001", "message": "Specified model not found or - not ready, Model Id: xx"}}' - headers: - apim-request-id: - - 9d1b81f6-672f-43ca-b929-8fb67cad519b - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 00:58:10 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '14' - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_authentication_successful_key.yaml deleted file mode 100644 index ae41ab734e75..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_authentication_successful_key.yaml +++ /dev/null @@ -1,159 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 147362 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '147362' - Content-Type: - - application/pdf - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - f48e3e3b-bfdc-45ef-bc81-bc71d757de8c - content-length: - - '0' - date: - - Fri, 30 Oct 2020 01:11:31 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/f48e3e3b-bfdc-45ef-bc81-bc71d757de8c - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '204' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/f48e3e3b-bfdc-45ef-bc81-bc71d757de8c - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:11:32Z", "lastUpdatedDateTime": - "2020-10-30T01:11:32Z"}' - headers: - apim-request-id: - - 13e0b1d8-140a-4bc3-bdfc-a6e847e57fc7 - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:11:37 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '10' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/f48e3e3b-bfdc-45ef-bc81-bc71d757de8c - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:11:32Z", - "lastUpdatedDateTime": "2020-10-30T01:11:41Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: - - 8f2eceec-0210-4a1e-a064-26ea79a106c4 - content-length: - - '3516' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:11:42 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '17' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_pdf.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_pdf.yaml deleted file mode 100644 index a51059bedbd3..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice.test_invoice_pdf.yaml +++ /dev/null @@ -1,159 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 147362 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '147362' - Content-Type: - - application/pdf - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 5ce55a9d-86c6-458e-91e1-3a3529b4778c - content-length: - - '0' - date: - - Fri, 30 Oct 2020 01:11:31 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/5ce55a9d-86c6-458e-91e1-3a3529b4778c - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '168' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/5ce55a9d-86c6-458e-91e1-3a3529b4778c - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:11:32Z", "lastUpdatedDateTime": - "2020-10-30T01:11:33Z"}' - headers: - apim-request-id: - - d7ccaf72-7487-48b5-90a0-6f3de40a7d34 - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:11:36 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '12' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/5ce55a9d-86c6-458e-91e1-3a3529b4778c - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:11:32Z", - "lastUpdatedDateTime": "2020-10-30T01:11:41Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: - - 8b42a660-1a01-4319-afef-7adc82bcea21 - content-length: - - '3516' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:11:42 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '16' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_authentication_successful_key.yaml deleted file mode 100644 index 52610c5abe52..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_async.test_authentication_successful_key.yaml +++ /dev/null @@ -1,123 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 147362 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - application/pdf - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 89bb78b3-5496-4694-bf80-4be10a94037c - content-length: '0' - date: Fri, 30 Oct 2020 01:11:53 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/89bb78b3-5496-4694-bf80-4be10a94037c - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '219' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/89bb78b3-5496-4694-bf80-4be10a94037c - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:11:53Z", "lastUpdatedDateTime": - "2020-10-30T01:11:53Z"}' - headers: - apim-request-id: b91ef86c-3801-4729-9241-a86ccc512478 - content-length: '106' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:11:58 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '10' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/89bb78b3-5496-4694-bf80-4be10a94037c -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/89bb78b3-5496-4694-bf80-4be10a94037c - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:11:53Z", - "lastUpdatedDateTime": "2020-10-30T01:12:01Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: c9dcfbb5-a67d-45ac-8e48-426130686a61 - content-length: '3516' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:12:03 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '15' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/89bb78b3-5496-4694-bf80-4be10a94037c -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_authentication_successful_key.yaml deleted file mode 100644 index 95d07c21c180..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_authentication_successful_key.yaml +++ /dev/null @@ -1,158 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - e32efcde-972c-4e2f-9c84-e1fc5c3a46c5 - content-length: - - '0' - date: - - Fri, 30 Oct 2020 01:12:07 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/e32efcde-972c-4e2f-9c84-e1fc5c3a46c5 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '561' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/e32efcde-972c-4e2f-9c84-e1fc5c3a46c5 - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:12:07Z", "lastUpdatedDateTime": - "2020-10-30T01:12:07Z"}' - headers: - apim-request-id: - - 2720df13-419e-46cd-92e5-7f5f72dca9ce - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:12:12 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '12' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/e32efcde-972c-4e2f-9c84-e1fc5c3a46c5 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:12:07Z", - "lastUpdatedDateTime": "2020-10-30T01:12:15Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: - - d8ac1c38-25fb-4624-a3ad-fc45c1a3db5a - content-length: - - '3516' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:12:17 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '18' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_invoice_pdf.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_invoice_pdf.yaml deleted file mode 100644 index f37db9a7d48b..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url.test_invoice_pdf.yaml +++ /dev/null @@ -1,158 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 9f205604-2733-4a89-b16b-f1608dde3869 - content-length: - - '0' - date: - - Fri, 30 Oct 2020 01:12:26 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/9f205604-2733-4a89-b16b-f1608dde3869 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '214' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/9f205604-2733-4a89-b16b-f1608dde3869 - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:12:27Z", "lastUpdatedDateTime": - "2020-10-30T01:12:27Z"}' - headers: - apim-request-id: - - 8033baba-a5d8-4b72-a89c-6175146ade28 - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:12:31 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '9' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/9f205604-2733-4a89-b16b-f1608dde3869 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:12:27Z", - "lastUpdatedDateTime": "2020-10-30T01:12:35Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: - - 76ddc57a-d8a3-40e7-813a-0115e27e1298 - content-length: - - '3516' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 30 Oct 2020 01:12:36 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '15' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_authentication_successful_key.yaml deleted file mode 100644 index 2fd28bf7d769..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_authentication_successful_key.yaml +++ /dev/null @@ -1,124 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: cafbd0b8-dbb2-4138-8e04-26c97363637b - content-length: '0' - date: Fri, 30 Oct 2020 01:12:38 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/cafbd0b8-dbb2-4138-8e04-26c97363637b - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '374' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/cafbd0b8-dbb2-4138-8e04-26c97363637b - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:12:38Z", "lastUpdatedDateTime": - "2020-10-30T01:12:38Z"}' - headers: - apim-request-id: 6fd84b1b-d9f3-4b31-bf30-6c771ee8d461 - content-length: '106' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:12:43 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '10' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/cafbd0b8-dbb2-4138-8e04-26c97363637b -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/cafbd0b8-dbb2-4138-8e04-26c97363637b - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:12:38Z", - "lastUpdatedDateTime": "2020-10-30T01:12:45Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: af9fb896-90cb-42d5-be79-e06529bb68c1 - content-length: '3516' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:12:48 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '16' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/cafbd0b8-dbb2-4138-8e04-26c97363637b -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_invoice_pdf.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_invoice_pdf.yaml deleted file mode 100644 index 043b29d9db87..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_invoice_from_url_async.test_invoice_pdf.yaml +++ /dev/null @@ -1,124 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Invoice_1.pdf"}''' - headers: - Accept: - - application/json - Content-Length: - - '163' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 33947d19-0f67-461e-a4d2-29646a76a267 - content-length: '0' - date: Fri, 30 Oct 2020 01:12:54 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/33947d19-0f67-461e-a4d2-29646a76a267 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '410' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/invoice/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/33947d19-0f67-461e-a4d2-29646a76a267 - response: - body: - string: '{"status": "running", "createdDateTime": "2020-10-30T01:12:55Z", "lastUpdatedDateTime": - "2020-10-30T01:12:55Z"}' - headers: - apim-request-id: 5f473b72-70d8-413c-9694-ee28f7cbb0bf - content-length: '106' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:12:59 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '11' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/33947d19-0f67-461e-a4d2-29646a76a267 -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/33947d19-0f67-461e-a4d2-29646a76a267 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-10-30T01:12:55Z", - "lastUpdatedDateTime": "2020-10-30T01:13:02Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, - "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 3, "columns": - 6, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Invoice Number", "boundingBox": - [0.5136, 2.7829, 1.8978, 2.79, 1.8978, 3.311, 0.5136, 3.311]}, {"rowIndex": - 0, "columnIndex": 1, "text": "Invoice Date", "boundingBox": [1.8978, 2.79, - 3.2964, 2.79, 3.3036, 3.311, 1.8978, 3.311]}, {"rowIndex": 0, "columnIndex": - 2, "text": "Invoice Due Date", "boundingBox": [3.2964, 2.79, 4.7022, 2.79, - 4.7094, 3.311, 3.3036, 3.311]}, {"rowIndex": 0, "columnIndex": 3, "columnSpan": - 2, "text": "Charges", "boundingBox": [4.7022, 2.79, 6.1079, 2.7829, 6.1079, - 3.311, 4.7094, 3.311]}, {"rowIndex": 0, "columnIndex": 5, "text": "VAT ID", - "boundingBox": [6.1079, 2.7829, 7.485, 2.7829, 7.4922, 3.311, 6.1079, 3.311]}, - {"rowIndex": 1, "columnIndex": 0, "rowSpan": 2, "text": "34278587", "boundingBox": - [0.5136, 3.311, 1.8978, 3.311, 1.8978, 3.8534, 0.5136, 3.8534]}, {"rowIndex": - 1, "columnIndex": 1, "rowSpan": 2, "text": "6/18/2017", "boundingBox": [1.8978, - 3.311, 3.3036, 3.311, 3.3036, 3.8534, 1.8978, 3.8534]}, {"rowIndex": 1, "columnIndex": - 2, "rowSpan": 2, "text": "6/24/2017", "boundingBox": [3.3036, 3.311, 4.7094, - 3.311, 4.7165, 3.8534, 3.3036, 3.8534]}, {"rowIndex": 1, "columnIndex": 3, - "rowSpan": 2, "columnSpan": 2, "text": "$56,651.49", "boundingBox": [4.7094, - 3.311, 6.1079, 3.311, 6.1079, 3.8534, 4.7165, 3.8534]}, {"rowIndex": 1, "columnIndex": - 5, "text": "PT", "boundingBox": [6.1079, 3.311, 7.4922, 3.311, 7.4922, 3.6393, - 6.1079, 3.6393]}, {"rowIndex": 2, "columnIndex": 5, "boundingBox": [6.1079, - 3.6393, 7.4922, 3.6393, 7.4922, 3.8534, 6.1079, 3.8534]}], "boundingBox": - [0.4985, 2.7802, 7.4933, 2.7816, 7.4913, 3.8459, 0.4966, 3.8447]}]}], "documentResults": - [{"docType": "prebuilt:invoice", "pageRange": [1, 1], "fields": {"VendorName": - {"type": "string", "valueString": "Contoso", "text": "Contoso", "boundingBox": - [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "page": - 1, "confidence": 0.948}, "CustomerAddressRecipient": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}, - "VendorAddress": {"type": "string", "valueString": "1 Redmond way Suite 6000 - Redmond, WA 99243", "text": "1 Redmond way Suite 6000 Redmond, WA 99243", - "boundingBox": [0.8019, 1.7033, 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911], - "page": 1, "confidence": 0.908}, "CustomerAddress": {"type": "string", "valueString": - "1020 Enterprise Way Sunnayvale, CA 87659", "text": "1020 Enterprise Way Sunnayvale, - CA 87659", "boundingBox": [5.196, 1.716, 6.6526, 1.716, 6.6526, 2.0359, 5.196, - 2.0359], "page": 1, "confidence": 0.991}, "InvoiceId": {"type": "string", - "valueString": "34278587", "text": "34278587", "boundingBox": [0.5397, 3.411, - 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "page": 1, "confidence": 0.879}, - "InvoiceDate": {"type": "date", "valueDate": "2017-06-18", "text": "6/18/2017", - "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], - "page": 1, "confidence": 0.929}, "DueDate": {"type": "date", "valueDate": - "2017-06-24", "text": "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, - 3.9514, 3.5144, 3.346, 3.5144], "page": 1, "confidence": 0.992}, "InvoiceTotal": - {"type": "number", "valueNumber": 56651.49, "text": "$56,651.49", "boundingBox": - [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "page": - 1, "confidence": 0.895}, "CustomerName": {"type": "string", "valueString": - "Microsoft", "text": "Microsoft", "boundingBox": [5.2045, 1.5114, 5.8155, - 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "page": 1, "confidence": 0.986}}}]}}' - headers: - apim-request-id: 6deec844-29f9-477a-9229-6602fa318ceb - content-length: '3516' - content-type: application/json; charset=utf-8 - date: Fri, 30 Oct 2020 01:13:04 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '14' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/33947d19-0f67-461e-a4d2-29646a76a267 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_successful_key.yaml deleted file mode 100644 index 65f7f29d61fd..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_successful_key.yaml +++ /dev/null @@ -1,115 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 154512 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '154512' - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4 - content-length: - - '0' - date: - - Mon, 16 Nov 2020 19:08:58 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '677' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:08:58Z", - "lastUpdatedDateTime": "2020-11-16T19:09:02Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: - - c2856806-d705-4338-be31-aa24fa0c3489 - content-length: - - '2835' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 16 Nov 2020 19:09:03 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '95' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_jpg.yaml deleted file mode 100644 index 87863b7f3fa7..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_receipt_jpg.yaml +++ /dev/null @@ -1,115 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 154512 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '154512' - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - ea43995f-d321-4daa-8d98-d186857419ee - content-length: - - '0' - date: - - Tue, 26 Jan 2021 18:16:12 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/ea43995f-d321-4daa-8d98-d186857419ee - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '380' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/ea43995f-d321-4daa-8d98-d186857419ee - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2021-01-26T18:16:12Z", - "lastUpdatedDateTime": "2021-01-26T18:16:15Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: - - 857c7fd7-8c39-4123-8fd5-6b7f74bf7f04 - content-length: - - '2835' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 26 Jan 2021 18:16:17 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '38' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_authentication_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_authentication_successful_key.yaml deleted file mode 100644 index 3ab74609cced..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_authentication_successful_key.yaml +++ /dev/null @@ -1,91 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 154512 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 4dcc100a-b8bf-461c-9bb5-e1692dbbea4d - content-length: '0' - date: Mon, 16 Nov 2020 19:10:28 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/4dcc100a-b8bf-461c-9bb5-e1692dbbea4d - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '196' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/4dcc100a-b8bf-461c-9bb5-e1692dbbea4d - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:10:28Z", - "lastUpdatedDateTime": "2020-11-16T19:10:31Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: a0fd00ee-d32c-4126-b0fc-193c74165eea - content-length: '2835' - content-type: application/json; charset=utf-8 - date: Mon, 16 Nov 2020 19:10:33 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '22' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/4dcc100a-b8bf-461c-9bb5-e1692dbbea4d -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_jpg.yaml deleted file mode 100644 index 7923c3bb9c07..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_async.test_receipt_jpg.yaml +++ /dev/null @@ -1,91 +0,0 @@ -interactions: -- request: - body: '!!! The request body has been omitted from the recording because its size - 154512 is larger than 128KB. !!!' - headers: - Accept: - - application/json - Content-Type: - - image/jpeg - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 61b63053-6dbd-4c0d-8179-402a85292659 - content-length: '0' - date: Tue, 26 Jan 2021 18:18:33 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/61b63053-6dbd-4c0d-8179-402a85292659 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '204' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/61b63053-6dbd-4c0d-8179-402a85292659 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2021-01-26T18:18:34Z", - "lastUpdatedDateTime": "2021-01-26T18:18:35Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: a1c7f2d5-a30e-4c9c-a11c-9f618fbc1b86 - content-length: '2835' - content-type: application/json; charset=utf-8 - date: Tue, 26 Jan 2021 18:18:38 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '36' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/61b63053-6dbd-4c0d-8179-402a85292659 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_auth_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_auth_successful_key.yaml deleted file mode 100644 index a868d7c5fde1..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_auth_successful_key.yaml +++ /dev/null @@ -1,114 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-allinone.jpg"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '172' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 1d9208f5-d763-418f-aacc-accda1ffb3c4 - content-length: - - '0' - date: - - Mon, 16 Nov 2020 19:12:46 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1d9208f5-d763-418f-aacc-accda1ffb3c4 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '216' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1d9208f5-d763-418f-aacc-accda1ffb3c4 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:12:46Z", - "lastUpdatedDateTime": "2020-11-16T19:12:50Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: - - 14997096-9819-4416-8b9f-948c44eb2dc8 - content-length: - - '2835' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 16 Nov 2020 19:12:51 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '23' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_jpg.yaml deleted file mode 100644 index 9d632a292218..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url.test_receipt_url_jpg.yaml +++ /dev/null @@ -1,114 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-allinone.jpg"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '172' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: - - 9e12b5f2-c671-46ed-b33f-1aa6b583f6c2 - content-length: - - '0' - date: - - Tue, 26 Jan 2021 18:20:06 GMT - operation-location: - - https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/9e12b5f2-c671-46ed-b33f-1aa6b583f6c2 - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '527' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/9e12b5f2-c671-46ed-b33f-1aa6b583f6c2 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2021-01-26T18:20:07Z", - "lastUpdatedDateTime": "2021-01-26T18:20:09Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: - - e85f11d3-0813-4f70-9bdf-a216b1567874 - content-length: - - '2835' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 26 Jan 2021 18:20:11 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '80' - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_auth_successful_key.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_auth_successful_key.yaml deleted file mode 100644 index 5411cd71f79c..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_auth_successful_key.yaml +++ /dev/null @@ -1,92 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-allinone.jpg"}''' - headers: - Accept: - - application/json - Content-Length: - - '172' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 8f941af5-42eb-4349-a9e6-deb7a1c27795 - content-length: '0' - date: Mon, 16 Nov 2020 19:14:20 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/8f941af5-42eb-4349-a9e6-deb7a1c27795 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '194' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/8f941af5-42eb-4349-a9e6-deb7a1c27795 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:14:20Z", - "lastUpdatedDateTime": "2020-11-16T19:14:22Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: 39ccf8d5-c787-4893-991f-45beb280ef0e - content-length: '2835' - content-type: application/json; charset=utf-8 - date: Mon, 16 Nov 2020 19:14:24 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '22' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/8f941af5-42eb-4349-a9e6-deb7a1c27795 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_jpg.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_jpg.yaml deleted file mode 100644 index f55d896c9dcf..000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt_from_url_async.test_receipt_url_jpg.yaml +++ /dev/null @@ -1,92 +0,0 @@ -interactions: -- request: - body: 'b''{"source": "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-allinone.jpg"}''' - headers: - Accept: - - application/json - Content-Length: - - '172' - Content-Type: - - application/json - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false - response: - body: - string: '' - headers: - apim-request-id: 1cd31914-408c-47eb-9b03-42abd6deab62 - content-length: '0' - date: Tue, 26 Jan 2021 18:22:48 GMT - operation-location: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1cd31914-408c-47eb-9b03-42abd6deab62 - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '395' - status: - code: 202 - message: Accepted - url: https://centraluseuap.api.cognitive.microsoft.com//formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false -- request: - body: null - headers: - User-Agent: - - azsdk-python-ai-formrecognizer/3.1.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1cd31914-408c-47eb-9b03-42abd6deab62 - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2021-01-26T18:22:48Z", - "lastUpdatedDateTime": "2021-01-26T18:22:51Z", "analyzeResult": {"version": - "2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height": - 3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt", - "pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString": - "Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString": - "Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4, - 1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613}, - "MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond, - WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302, - 675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence": - 0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber": - "+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057, - 647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate": - {"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox": - [267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99}, - "TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59", - "boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence": - 0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject": - {"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox": - [245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92}, - "Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino", - "boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence": - 0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20", - "boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1, - "confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type": - "number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836, - 285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string", - "valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308, - 1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916}, - "TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": - [1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence": - 0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", - "boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1, - "confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text": - "1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page": - 1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text": - "1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page": - 1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5, - "text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030, - 2739], "page": 1, "confidence": 0.985}}}]}}' - headers: - apim-request-id: 1c3d70cd-08ea-44e1-9127-ad517b5b8e67 - content-length: '2835' - content-type: application/json; charset=utf-8 - date: Tue, 26 Jan 2021 18:22:52 GMT - strict-transport-security: max-age=31536000; includeSubDomains; preload - x-content-type-options: nosniff - x-envoy-upstream-service-time: '40' - status: - code: 200 - message: OK - url: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1cd31914-408c-47eb-9b03-42abd6deab62 -version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index 79749dba4850..6977783a1653 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -176,10 +176,10 @@ def test_receipt_url_include_field_elements(self, client): self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) - self.assertFormPagesHasValues(receipt.pages) receipt_type = receipt.fields.get("ReceiptType") self.assertIsNotNone(receipt_type.confidence) self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, True) @FormRecognizerPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index 2dcf41c2aa4b..75e28c0db103 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -201,10 +201,10 @@ async def test_receipt_url_include_field_elements(self, client): self.assertEqual(receipt.fields.get("TransactionTime").value, time(hour=13, minute=59, second=0)) self.assertEqual(receipt.page_range.first_page_number, 1) self.assertEqual(receipt.page_range.last_page_number, 1) - self.assertFormPagesHasValues(receipt.pages) receipt_type = receipt.fields.get("ReceiptType") self.assertIsNotNone(receipt_type.confidence) self.assertEqual(receipt_type.value, 'Itemized') + self.assertReceiptItemsHasValues(receipt.fields["Items"].value, receipt.page_range.first_page_number, True) @FormRecognizerPreparer() @GlobalClientPreparer()