Skip to content

Commit b0608ea

Browse files
Removing function_invoke_option testcases
1 parent 6a2b7bd commit b0608ea

2 files changed

Lines changed: 5 additions & 26 deletions

File tree

tests/test_cli.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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."""

tests/test_sf_cli_contract.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -188,26 +188,6 @@ def test_accepts_network_flag(
188188
result = runner.invoke(deploy, [*self._BASE_ARGS, "--network", "custom"])
189189
assert result.exit_code != 2, result.output
190190

191-
@patch("datacustomcode.token_provider.SFCLITokenProvider")
192-
@patch("datacustomcode.deploy.deploy_full")
193-
@patch("datacustomcode.cli.find_base_directory")
194-
@patch("datacustomcode.cli.get_package_type")
195-
def test_accepts_function_invoke_opt_flag(
196-
self, mock_pkg_type, mock_find_base, mock_deploy_full, mock_sf_cli_provider
197-
):
198-
mock_find_base.return_value = "payload"
199-
mock_pkg_type.return_value = "function"
200-
mock_provider_instance = mock_sf_cli_provider.return_value
201-
mock_provider_instance.get_token.return_value = AccessTokenResponse(
202-
access_token="tok", instance_url="https://example.com"
203-
)
204-
runner = CliRunner()
205-
result = runner.invoke(
206-
deploy, [*self._BASE_ARGS, "--function-invoke-opt", "ASYNC"]
207-
)
208-
assert result.exit_code != 2, result.output
209-
210-
211191
class TestRunArgContract:
212192
"""
213193
SF CLI spawn:

0 commit comments

Comments
 (0)