@@ -1096,11 +1096,26 @@ def test_run_post_install_smoke_rejects_miseledger_nonzero_exit(tmp_path):
10961096 run_post_install_smoke (managed )
10971097
10981098
1099+ SESSIONFIND_V060_HELP = (
1100+ "sessionfind list [--source KIND] ...\n sessionfind search <query> ...\n sessionfind <query> ...\n "
1101+ )
1102+
1103+
10991104def test_run_post_install_smoke_accepts_sessionfind_help_exit_zero (tmp_path ):
11001105 managed = _write_managed_smoke_stubs (tmp_path )
11011106 run_post_install_smoke (managed )
11021107
11031108
1109+ def test_run_post_install_smoke_accepts_sessionfind_v060_help_shape (tmp_path ):
1110+ script = (
1111+ '#!/usr/bin/env python3\n import sys\n if sys.argv[1:] == ["--help"]:\n '
1112+ f' print({ SESSIONFIND_V060_HELP !r} , end="")\n raise SystemExit(0)\n raise SystemExit(1)\n '
1113+ )
1114+ managed = _write_managed_smoke_stubs (tmp_path )
1115+ managed ["sessionfind" ] = _write_managed_stub (tmp_path , "sessionfind" , script = script )
1116+ run_post_install_smoke (managed )
1117+
1118+
11041119def test_run_post_install_smoke_rejects_sessionfind_nonzero_exit (tmp_path ):
11051120 managed = _write_managed_smoke_stubs (tmp_path )
11061121 script = smoke_stub_script ("sessionfind" ).replace ("raise SystemExit(0)" , "raise SystemExit(2)" , 1 )
@@ -1109,14 +1124,14 @@ def test_run_post_install_smoke_rejects_sessionfind_nonzero_exit(tmp_path):
11091124 run_post_install_smoke (managed )
11101125
11111126
1112- def test_run_post_install_smoke_rejects_sessionfind_missing_usage (tmp_path ):
1127+ def test_run_post_install_smoke_rejects_sessionfind_missing_help (tmp_path ):
11131128 script = (
11141129 '#!/usr/bin/env python3\n import sys\n if sys.argv[1:] == ["--help"]:\n '
11151130 ' print("options only")\n raise SystemExit(0)\n raise SystemExit(1)\n '
11161131 )
11171132 managed = _write_managed_smoke_stubs (tmp_path )
11181133 managed ["sessionfind" ] = _write_managed_stub (tmp_path , "sessionfind" , script = script )
1119- with pytest .raises (ComponentInstallError , match = "sessionfind smoke failed.*no usage text" ):
1134+ with pytest .raises (ComponentInstallError , match = "sessionfind smoke failed.*no help text" ):
11201135 run_post_install_smoke (managed )
11211136
11221137
0 commit comments