Skip to content

Commit ec6443e

Browse files
uncomment receipt test assertions - regression fixed (#15345)
1 parent 6be8888 commit ec6443e

File tree

64 files changed

+5086
-5548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5086
-5548
lines changed

sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_bad_key.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interactions:
2525
content-length:
2626
- '224'
2727
date:
28-
- Wed, 11 Nov 2020 18:03:28 GMT
28+
- Mon, 16 Nov 2020 19:08:57 GMT
2929
status:
3030
code: 401
3131
message: PermissionDenied

sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_authentication_successful_key.yaml

+48-48
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ interactions:
2222
string: ''
2323
headers:
2424
apim-request-id:
25-
- fd0ce4b0-afb2-47bc-887d-863aa0e76163
25+
- 1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4
2626
content-length:
2727
- '0'
2828
date:
29-
- Wed, 11 Nov 2020 18:03:31 GMT
29+
- Mon, 16 Nov 2020 19:08:58 GMT
3030
operation-location:
31-
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/fd0ce4b0-afb2-47bc-887d-863aa0e76163
31+
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4
3232
strict-transport-security:
3333
- max-age=31536000; includeSubDomains; preload
3434
x-content-type-options:
3535
- nosniff
3636
x-envoy-upstream-service-time:
37-
- '1385'
37+
- '677'
3838
status:
3939
code: 202
4040
message: Accepted
@@ -50,65 +50,65 @@ interactions:
5050
User-Agent:
5151
- azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0)
5252
method: GET
53-
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/fd0ce4b0-afb2-47bc-887d-863aa0e76163
53+
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/1ff5365d-b8b3-4448-af6d-93b5f1e9a8e4
5454
response:
5555
body:
56-
string: '{"status": "succeeded", "createdDateTime": "2020-11-11T18:03:30Z",
57-
"lastUpdatedDateTime": "2020-11-11T18:03:34Z", "analyzeResult": {"version":
58-
"2.1.0", "readResults": [{"page": 1, "angle": 0.1273, "width": 1688, "height":
56+
string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:08:58Z",
57+
"lastUpdatedDateTime": "2020-11-16T19:09:02Z", "analyzeResult": {"version":
58+
"2.1.0", "readResults": [{"page": 1, "angle": 0.6893, "width": 1688, "height":
5959
3000, "unit": "pixel"}], "documentResults": [{"docType": "prebuilt:receipt",
6060
"pageRange": [1, 1], "fields": {"ReceiptType": {"type": "string", "valueString":
61-
"Itemized", "confidence": 0.99}, "MerchantName": {"type": "string", "valueString":
62-
"Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [380.9, 282.9,
63-
1116, 473.2, 1025, 824.4, 290, 634], "page": 1, "confidence": 0.716}, "MerchantAddress":
64-
{"type": "string", "valueString": "123 Main Street Redmond, WA 98052", "text":
65-
"123 Main Street Redmond, WA 98052", "boundingBox": [298.3, 676.5, 844.6,
66-
781.5, 810.7, 958, 264.4, 853], "page": 1, "confidence": 0.989}, "MerchantPhoneNumber":
67-
{"type": "phoneNumber", "valuePhoneNumber": "+19876543210", "text": "987-654-3210",
68-
"boundingBox": [271, 1000, 651, 1049, 643, 1125, 264, 1075], "page": 1, "confidence":
69-
0.99}, "TransactionDate": {"type": "date", "valueDate": "2019-06-10", "text":
70-
"6/10/2019", "boundingBox": [259, 1224, 510, 1246, 505, 1331, 255, 1312],
71-
"page": 1, "confidence": 0.99}, "TransactionTime": {"type": "time", "valueTime":
72-
"13:59:00", "text": "13:59", "boundingBox": [527, 1248, 681, 1262, 675, 1341,
73-
522, 1332], "page": 1, "confidence": 0.989}, "Items": {"type": "array", "valueArray":
74-
[{"type": "object", "valueObject": {"Quantity": {"type": "number", "valueNumber":
75-
1, "text": "1", "boundingBox": [244, 1581, 288, 1584, 285, 1678, 241, 1675],
76-
"page": 1, "confidence": 0.919}, "Name": {"type": "string", "valueString":
77-
"Cappuccino", "text": "Cappuccino", "boundingBox": [306, 1585, 658, 1598,
78-
657, 1688, 304, 1679], "page": 1, "confidence": 0.959}, "TotalPrice": {"type":
79-
"number", "valueNumber": 2.2, "text": "$2.20", "boundingBox": [1106, 1579,
80-
1260, 1574, 1263, 1656, 1108, 1662], "page": 1, "confidence": 0.959}}}, {"type":
81-
"object", "valueObject": {"Quantity": {"type": "number", "valueNumber": 1,
82-
"text": "1", "boundingBox": [227, 1839, 278, 1839, 277, 1924, 226, 1924],
83-
"page": 1, "confidence": 0.91}, "Name": {"type": "string", "valueString":
84-
"BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [294, 1839, 737, 1839,
85-
737, 1924, 294, 1924], "page": 1, "confidence": 0.955}, "TotalPrice": {"type":
86-
"number", "valueNumber": 9.5, "text": "$9.5", "boundingBox": [1134, 1948,
87-
1252, 1948, 1252, 2041, 1134, 2041], "page": 1, "confidence": 0.958}}}]},
88-
"Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70", "boundingBox":
89-
[1139, 2228, 1309, 2228, 1308, 2313, 1138, 2313], "page": 1, "confidence":
90-
0.923}, "Tax": {"type": "number", "valueNumber": 1.17, "text": "1.17", "boundingBox":
91-
[1186, 2356, 1307, 2361, 1303, 2452, 1182, 2447], "page": 1, "confidence":
92-
0.979}, "Tip": {"type": "number", "valueNumber": 463, "text": "$463", "boundingBox":
93-
[1034, 2483, 1268, 2488, 1266, 2583, 1032, 2577], "page": 1, "confidence":
94-
0.975}, "Total": {"type": "number", "valueNumber": 14.5, "text": "$14.50",
95-
"boundingBox": [1033, 2623, 1376, 2641, 1370, 2758, 1027, 2740], "page": 1,
96-
"confidence": 0.987}}}]}}'
61+
"Itemized", "confidence": 0.692}, "MerchantName": {"type": "string", "valueString":
62+
"Contoso Contoso", "text": "Contoso Contoso", "boundingBox": [378.2, 292.4,
63+
1117.7, 468.3, 1035.7, 812.7, 296.3, 636.8], "page": 1, "confidence": 0.613},
64+
"MerchantAddress": {"type": "string", "valueString": "123 Main Street Redmond,
65+
WA 98052", "text": "123 Main Street Redmond, WA 98052", "boundingBox": [302,
66+
675.8, 848.1, 793.7, 809.9, 970.4, 263.9, 852.5], "page": 1, "confidence":
67+
0.99}, "MerchantPhoneNumber": {"type": "phoneNumber", "valuePhoneNumber":
68+
"+19876543210", "text": "987-654-3210", "boundingBox": [278, 1004, 656, 1057,
69+
647, 1123, 271, 1075], "page": 1, "confidence": 0.99}, "TransactionDate":
70+
{"type": "date", "valueDate": "2019-06-10", "text": "6/10/2019", "boundingBox":
71+
[267, 1229, 525, 1247, 517, 1332, 259, 1313], "page": 1, "confidence": 0.99},
72+
"TransactionTime": {"type": "time", "valueTime": "13:59:00", "text": "13:59",
73+
"boundingBox": [541, 1248, 677, 1263, 669, 1345, 533, 1333], "page": 1, "confidence":
74+
0.977}, "Items": {"type": "array", "valueArray": [{"type": "object", "valueObject":
75+
{"Quantity": {"type": "number", "valueNumber": 1, "text": "1", "boundingBox":
76+
[245, 1583, 299, 1585, 295, 1676, 241, 1671], "page": 1, "confidence": 0.92},
77+
"Name": {"type": "string", "valueString": "Cappuccino", "text": "Cappuccino",
78+
"boundingBox": [322, 1586, 654, 1605, 648, 1689, 318, 1678], "page": 1, "confidence":
79+
0.923}, "TotalPrice": {"type": "number", "valueNumber": 2.2, "text": "$2.20",
80+
"boundingBox": [1108, 1584, 1263, 1574, 1268, 1656, 1113, 1666], "page": 1,
81+
"confidence": 0.918}}}, {"type": "object", "valueObject": {"Quantity": {"type":
82+
"number", "valueNumber": 1, "text": "1", "boundingBox": [232, 1834, 286, 1836,
83+
285, 1920, 231, 1920], "page": 1, "confidence": 0.858}, "Name": {"type": "string",
84+
"valueString": "BACON & EGGS", "text": "BACON & EGGS", "boundingBox": [308,
85+
1836, 746, 1841.4, 745, 1925.4, 307, 1920], "page": 1, "confidence": 0.916},
86+
"TotalPrice": {"type": "number", "valueNumber": 9.5, "text": "$9.5", "boundingBox":
87+
[1135, 1955, 1257, 1952, 1259, 2036, 1136, 2039], "page": 1, "confidence":
88+
0.916}}}]}, "Subtotal": {"type": "number", "valueNumber": 11.7, "text": "11.70",
89+
"boundingBox": [1146, 2221, 1297, 2223, 1296, 2319, 1145, 2317], "page": 1,
90+
"confidence": 0.955}, "Tax": {"type": "number", "valueNumber": 1.17, "text":
91+
"1.17", "boundingBox": [1190, 2359, 1304, 2359, 1304, 2456, 1190, 2456], "page":
92+
1, "confidence": 0.979}, "Tip": {"type": "number", "valueNumber": 1.63, "text":
93+
"1.63", "boundingBox": [1094, 2479, 1267, 2485, 1264, 2591, 1091, 2585], "page":
94+
1, "confidence": 0.941}, "Total": {"type": "number", "valueNumber": 14.5,
95+
"text": "$14.50", "boundingBox": [1034, 2620, 1384, 2638, 1380, 2763, 1030,
96+
2739], "page": 1, "confidence": 0.985}}}]}}'
9797
headers:
9898
apim-request-id:
99-
- 6d4f38cc-a802-4e2f-8e13-b3bd85a0bd69
99+
- c2856806-d705-4338-be31-aa24fa0c3489
100100
content-length:
101-
- '2820'
101+
- '2835'
102102
content-type:
103103
- application/json; charset=utf-8
104104
date:
105-
- Wed, 11 Nov 2020 18:03:35 GMT
105+
- Mon, 16 Nov 2020 19:09:03 GMT
106106
strict-transport-security:
107107
- max-age=31536000; includeSubDomains; preload
108108
x-content-type-options:
109109
- nosniff
110110
x-envoy-upstream-service-time:
111-
- '57'
111+
- '95'
112112
status:
113113
code: 200
114114
message: OK

sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_blank_page.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -472,19 +472,19 @@ interactions:
472472
string: ''
473473
headers:
474474
apim-request-id:
475-
- 92427657-528f-468c-8503-24385ba4fb0a
475+
- af108532-ae00-46c2-a8b5-b316dd512760
476476
content-length:
477477
- '0'
478478
date:
479-
- Wed, 11 Nov 2020 18:03:37 GMT
479+
- Mon, 16 Nov 2020 19:09:04 GMT
480480
operation-location:
481-
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/92427657-528f-468c-8503-24385ba4fb0a
481+
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/af108532-ae00-46c2-a8b5-b316dd512760
482482
strict-transport-security:
483483
- max-age=31536000; includeSubDomains; preload
484484
x-content-type-options:
485485
- nosniff
486486
x-envoy-upstream-service-time:
487-
- '203'
487+
- '119'
488488
status:
489489
code: 202
490490
message: Accepted
@@ -500,29 +500,29 @@ interactions:
500500
User-Agent:
501501
- azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0)
502502
method: GET
503-
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/92427657-528f-468c-8503-24385ba4fb0a
503+
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/af108532-ae00-46c2-a8b5-b316dd512760
504504
response:
505505
body:
506-
string: '{"status": "succeeded", "createdDateTime": "2020-11-11T18:03:37Z",
507-
"lastUpdatedDateTime": "2020-11-11T18:03:39Z", "analyzeResult": {"version":
506+
string: '{"status": "succeeded", "createdDateTime": "2020-11-16T19:09:04Z",
507+
"lastUpdatedDateTime": "2020-11-16T19:09:08Z", "analyzeResult": {"version":
508508
"2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11,
509509
"unit": "inch"}], "documentResults": [{"docType": "prebuilt:receipt", "pageRange":
510510
[1, 1], "fields": {}}]}}'
511511
headers:
512512
apim-request-id:
513-
- 082e6567-eb58-4457-af91-24783fd1ff21
513+
- 72063e63-d1b4-4f6b-8ac5-2f7ab23a4617
514514
content-length:
515515
- '300'
516516
content-type:
517517
- application/json; charset=utf-8
518518
date:
519-
- Wed, 11 Nov 2020 18:03:42 GMT
519+
- Mon, 16 Nov 2020 19:09:09 GMT
520520
strict-transport-security:
521521
- max-age=31536000; includeSubDomains; preload
522522
x-content-type-options:
523523
- nosniff
524524
x-envoy-upstream-service-time:
525-
- '359'
525+
- '16'
526526
status:
527527
code: 200
528528
message: OK

sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_damaged_file_passed_as_bytes.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ interactions:
1818
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false
1919
response:
2020
body:
21-
string: '{"error": {"code": "BadArgument", "innerError": {"requestId": "bab9230b-4ff3-42aa-81c8-b00582452cb6"},
21+
string: '{"error": {"code": "BadArgument", "innerError": {"requestId": "a533931f-55a1-4fd1-ad36-3c11ec5618a2"},
2222
"message": "Bad or unrecognizable request JSON or binary file."}}'
2323
headers:
2424
apim-request-id:
25-
- bab9230b-4ff3-42aa-81c8-b00582452cb6
25+
- a533931f-55a1-4fd1-ad36-3c11ec5618a2
2626
content-length:
2727
- '161'
2828
content-type:
2929
- application/json; charset=utf-8
3030
date:
31-
- Wed, 11 Nov 2020 18:03:43 GMT
31+
- Mon, 16 Nov 2020 19:09:09 GMT
3232
strict-transport-security:
3333
- max-age=31536000; includeSubDomains; preload
3434
x-content-type-options:
3535
- nosniff
3636
x-envoy-upstream-service-time:
37-
- '10'
37+
- '5'
3838
status:
3939
code: 400
4040
message: Bad Request

sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_receipt.test_damaged_file_passed_as_bytes_io.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ interactions:
2323
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyze?includeTextDetails=false
2424
response:
2525
body:
26-
string: '{"error": {"code": "BadArgument", "innerError": {"requestId": "41b84122-4e73-4fdd-9c54-f7bff0ad6907"},
26+
string: '{"error": {"code": "BadArgument", "innerError": {"requestId": "f82a52be-58f7-4e3c-a6db-02b08933fb78"},
2727
"message": "Bad or unrecognizable request JSON or binary file."}}'
2828
headers:
2929
apim-request-id:
30-
- 41b84122-4e73-4fdd-9c54-f7bff0ad6907
30+
- f82a52be-58f7-4e3c-a6db-02b08933fb78
3131
content-length:
3232
- '161'
3333
content-type:
3434
- application/json; charset=utf-8
3535
date:
36-
- Wed, 11 Nov 2020 18:03:44 GMT
36+
- Mon, 16 Nov 2020 19:09:11 GMT
3737
strict-transport-security:
3838
- max-age=31536000; includeSubDomains; preload
3939
x-content-type-options:
4040
- nosniff
4141
x-envoy-upstream-service-time:
42-
- '11'
42+
- '5'
4343
status:
4444
code: 400
4545
message: Bad Request

0 commit comments

Comments
 (0)