From 64c16c715d777a51df747ab3b59e4c00cc0148d1 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Fri, 18 Feb 2022 18:49:54 -0100 Subject: [PATCH] Textract - request parameters are part of the body --- moto/textract/models.py | 2 +- moto/textract/responses.py | 2 +- tests/test_textract/test_textract.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/textract/models.py b/moto/textract/models.py index 50cada95a..1668a7c3c 100644 --- a/moto/textract/models.py +++ b/moto/textract/models.py @@ -53,7 +53,7 @@ class TextractBackend(BaseBackend): ): if not document_location: raise InvalidParameterException() - job_id = uuid.uuid4() + job_id = str(uuid.uuid4()) self.async_text_detection_jobs[job_id] = TextractJob({ "Blocks": TextractBackend.BLOCKS, "DetectDocumentTextModelVersion": "1.0", diff --git a/moto/textract/responses.py b/moto/textract/responses.py index 712b755e8..f214659a6 100644 --- a/moto/textract/responses.py +++ b/moto/textract/responses.py @@ -27,7 +27,7 @@ class TextractResponse(BaseResponse): def start_document_text_detection(self): - params = self._get_params() + params = json.loads(self.body) document_location = params.get("DocumentLocation") client_request_token = params.get("ClientRequestToken") job_tag = params.get("JobTag") diff --git a/tests/test_textract/test_textract.py b/tests/test_textract/test_textract.py index bac56cdad..a5e739a7e 100644 --- a/tests/test_textract/test_textract.py +++ b/tests/test_textract/test_textract.py @@ -28,4 +28,4 @@ def test_start_document_text_detection(): }, ) - raise Exception("NotYetImplemented") + resp.should.have.key("JobId")