@@ -190,19 +190,19 @@ def test_prepare_prompt_from_template(self, service):
190190 assert result == "Formatted prompt"
191191
192192 @patch ("idp_common.s3.get_text_content" )
193- @patch ("idp_common.s3.get_binary_content " )
193+ @patch ("idp_common.image.prepare_image " )
194194 @patch (
195195 "idp_common.classification.service.ClassificationService._invoke_bedrock_model"
196196 )
197197 @patch ("idp_common.image.prepare_bedrock_image_attachment" )
198198 def test_classify_page_bedrock_success (
199- self , mock_prepare_image , mock_invoke , mock_get_binary , mock_get_text , service
199+ self , mock_prepare_bedrock_image , mock_invoke , mock_prepare_image , mock_get_text , service
200200 ):
201201 """Test successful page classification with Bedrock."""
202202 # Mock responses
203203 mock_get_text .return_value = "This is an invoice for $100"
204- mock_get_binary .return_value = b"image_data"
205- mock_prepare_image .return_value = {"image" : "base64_encoded_image" }
204+ mock_prepare_image .return_value = b"image_data"
205+ mock_prepare_bedrock_image .return_value = {"image" : "base64_encoded_image" }
206206 mock_invoke .return_value = {
207207 "response" : {
208208 "output" : {"message" : {"content" : [{"text" : '{"class": "invoice"}' }]}}
@@ -227,8 +227,8 @@ def test_classify_page_bedrock_success(
227227
228228 # Verify calls
229229 mock_get_text .assert_called_once_with ("s3://bucket/text.txt" )
230- mock_get_binary .assert_called_once_with ("s3://bucket/image.jpg" )
231- mock_prepare_image .assert_called_once_with (b"image_data" )
230+ mock_prepare_image .assert_called_once_with ("s3://bucket/image.jpg" , 951 , 1268 )
231+ mock_prepare_bedrock_image .assert_called_once_with (b"image_data" )
232232 mock_invoke .assert_called_once ()
233233
234234 @patch ("idp_common.s3.get_text_content" )
0 commit comments