File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
tests/unittests/cli/utils Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,35 @@ def test_cli_deploy_cloud_run_allows_empty_gcloud_args(
386386 assert extra_args == ()
387387
388388
389+ def test_cli_deploy_cloud_run_python_version (
390+ tmp_path : Path , monkeypatch : pytest .MonkeyPatch
391+ ) -> None :
392+ """--python_version should be forwarded to cli_deploy.to_cloud_run."""
393+ rec = _Recorder ()
394+ monkeypatch .setattr (cli_tools_click .cli_deploy , "to_cloud_run" , rec )
395+
396+ agent_dir = tmp_path / "agent_cr_pyver"
397+ agent_dir .mkdir ()
398+ runner = CliRunner ()
399+ result = runner .invoke (
400+ cli_tools_click .main ,
401+ [
402+ "deploy" ,
403+ "cloud_run" ,
404+ "--project" ,
405+ "proj" ,
406+ "--region" ,
407+ "us-central1" ,
408+ "--python_version" ,
409+ "3.12" ,
410+ str (agent_dir ),
411+ ],
412+ )
413+ assert result .exit_code == 0
414+ assert rec .calls , "cli_deploy.to_cloud_run must be invoked"
415+ assert rec .calls [0 ][1 ].get ("python_version" ) == "3.12"
416+
417+
389418# cli deploy agent_engine
390419def test_cli_deploy_agent_engine_success (
391420 tmp_path : Path , monkeypatch : pytest .MonkeyPatch
You can’t perform that action at this time.
0 commit comments