@@ -103,16 +103,19 @@ def test_deploy_command_success(self, mock_token_provider, mock_deploy_full):
103103 assert call_args [0 ][2 ].access_token == "test_token"
104104 assert call_args [0 ][2 ].instance_url == "https://instance.example.com"
105105
106+ @patch ("datacustomcode.deploy.infer_use_in_feature" )
106107 @patch ("datacustomcode.deploy.deploy_full" )
107108 @patch ("datacustomcode.token_provider.CredentialsTokenProvider" )
108109 def test_deploy_command_function_invoke_options (
109- self , mock_token_provider , mock_deploy_full
110+ self , mock_token_provider , mock_deploy_full , mock_infer_feature
110111 ):
111112 """Test deploy command with function invoke options."""
112113 mock_provider_instance = mock_token_provider .return_value
113114 mock_provider_instance .get_token .return_value = AccessTokenResponse (
114115 access_token = "test_token" , instance_url = "https://instance.example.com"
115116 )
117+ # Mock infer_use_in_feature to return a valid feature
118+ mock_infer_feature .return_value = "SearchIndexChunking"
116119
117120 runner = CliRunner ()
118121 with runner .isolated_filesystem ():
@@ -122,16 +125,12 @@ def test_deploy_command_function_invoke_options(
122125 write_sdk_config ("." , sdk_config )
123126 result = runner .invoke (
124127 deploy ,
125- ["--name" , "test-job" , "--function-invoke-opt" , "option1,option2" ],
128+ ["--name" , "test-job" ],
126129 )
127130
128131 assert result .exit_code == 0
129132 mock_deploy_full .assert_called_once ()
130133
131- # Check that deploy_full was called with function invoke options
132- call_args = mock_deploy_full .call_args
133- assert call_args [0 ][1 ].functionInvokeOptions == ["option1" , "option2" ]
134-
135134 @patch ("datacustomcode.token_provider.CredentialsTokenProvider" )
136135 def test_deploy_command_credentials_error (self , mock_token_provider ):
137136 """Test deploy command when credentials are not available."""
0 commit comments