Skip to content

Commit 19eb7f2

Browse files
test(cli): add missing test for cloud_run python_version flag
1 parent 3a0afd4 commit 19eb7f2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

tests/unittests/cli/utils/test_cli_tools_click.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,37 @@ def test_cli_run_service_uris(
159159
tmp_path: Path,
160160
monkeypatch: pytest.MonkeyPatch,
161161
cli_args: list,
162+
163+
162164
expected_session_uri: Optional[str],
165+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
166+
) -> None:
167+
"""--python_version should be forwarded to cli_deploy.to_gke."""
168+
rec = _Recorder()
169+
monkeypatch.setattr(cli_tools_click.cli_deploy, "to_gke", rec)
170+
171+
agent_dir = tmp_path / "agent_gke_pyver"
172+
agent_dir.mkdir()
173+
runner = CliRunner()
174+
result = runner.invoke(
175+
cli_tools_click.main,
176+
[
177+
"deploy",
178+
"gke",
179+
"--project",
180+
"test-proj",
181+
"--region",
182+
"us-central1",
183+
"--cluster_name",
184+
"my-cluster",
185+
"--python_version",
186+
"3.13",
187+
str(agent_dir),
188+
],
189+
)
190+
assert result.exit_code == 0
191+
assert rec.calls, "cli_deploy.to_gke must be invoked"
192+
assert rec.calls[0][1].get("python_version") == "3.13"
163193
expected_artifact_uri: Optional[str],
164194
expected_memory_uri: Optional[str],
165195
) -> None:

0 commit comments

Comments
 (0)