diff --git a/tests/test_textract/test_server.py b/tests/test_textract/test_server.py index 72dc62d7ada1..d84f4a0b198c 100644 --- a/tests/test_textract/test_server.py +++ b/tests/test_textract/test_server.py @@ -23,6 +23,22 @@ def test_textract_start_text_detection(): assert isinstance(data["JobId"], str) +@mock_textract +def test_detect_document_text(): + backend = server.create_backend_app("textract") + test_client = backend.test_client() + headers = {"X-Amz-Target": "X-Amz-Target=Textract.DetectDocumentText"} + request_body = { + "DocumentLocation": { + "S3Object": {"Bucket": "bucket", "Name": "name", "Version": "version"} + } + } + resp = test_client.post("/", headers=headers, json=request_body) + data = json.loads(resp.data.decode("utf-8")) + assert resp.status_code == 200 + assert isinstance(data["Blocks"], list) + + @mock_textract def test_textract_start_text_detection_without_document_location(): backend = server.create_backend_app("textract")