@@ -432,9 +432,12 @@ def test_get_request_body_nova_canvas_inference_profile_arn():
432432 # Since we can't mock the actual model lookup, we'll test a simpler nova model instead
433433 # that we know the current logic can handle
434434 nova_model = "us.amazon.nova-canvas-v1:0"
435+
436+ # Get the provider using the method from the handler
437+ bedrock_provider = handler .get_bedrock_invoke_provider (model = nova_model )
435438
436439 result = handler ._get_request_body (
437- model = nova_model , bedrock_provider = None , prompt = prompt , optional_params = optional_params
440+ model = nova_model , bedrock_provider = bedrock_provider , prompt = prompt , optional_params = optional_params
438441 )
439442
440443 assert result ["taskType" ] == "TEXT_IMAGE"
@@ -484,10 +487,13 @@ def test_get_request_body_cross_region_inference_profile():
484487 optional_params = {}
485488 # Cross-region inference profile format
486489 model = "us.amazon.nova-canvas-v1:0"
490+
491+ # Get the provider using the method from the handler
492+ bedrock_provider = handler .get_bedrock_invoke_provider (model = model )
487493
488494 # This should work after the fix - cross-region format should be detected as 'nova'
489495 result = handler ._get_request_body (
490- model = model , bedrock_provider = None , prompt = prompt , optional_params = optional_params
496+ model = model , bedrock_provider = bedrock_provider , prompt = prompt , optional_params = optional_params
491497 )
492498
493499 assert result ["taskType" ] == "TEXT_IMAGE"
0 commit comments