← Về thư mục
scripts/test_run_guard_launcher.py
- _write_exec · function · L47-L51 — def _write_exec(path, body)
- _stub · function · L54-L57 — def _stub(path)
- _fake_real_python · function · L60-L63 — def _fake_real_python(path, real=REAL_PY)
- _run_launcher · function · L74-L100 — def _run_launcher(bin_dir, payload, extra_env=None, launcher=LAUNCHER)
- _make_plugin_layout · function · L103-L119 — def _make_plugin_layout(base, guard_body)
- _bucket_a_payload · function · L122-L129 — def _bucket_a_payload(workspace, file_path)
- LauncherNoPythonTest · class · L132-L182 — class LauncherNoPythonTest(unittest.TestCase)
- _assert_clean_passthrough · method · L135-L138 — def _assert_clean_passthrough(self, code, out, err)
- test_only_silent_stubs_on_path · method · L140-L148 — def test_only_silent_stubs_on_path(self): # All three candidates are stubs that exit 1 and print nothing (the marker probe sees # exactly what a 0-byte Store alias produces). bin_dir is FIRST on PATH so these # shadow any real system python.
- test_stubs_that_print_error_to_stderr · method · L150-L159 — def test_stubs_that_print_error_to_stderr(self): # A different stub variant: exits 1 AND writes a Windows-style error to stderr (closer # to "is not recognized" / Store-stub noise). The marker check is on STDOUT, so these # are still rejected. Confirms the launcher keys on the stdout marker, not exit text.
- test_marker_printed_but_nonzero_exit_rejected · method · L161-L172 — def test_marker_printed_but_nonzero_exit_rejected(self)
- test_no_timeout_binary_present · method · L174-L182 — def test_no_timeout_binary_present(self)
- LauncherRealPythonForwardsTest · class · L185-L220 — class LauncherRealPythonForwardsTest(unittest.TestCase)
- test_in_scope_write_passthrough_forwarded · method · L188-L199 — def test_in_scope_write_passthrough_forwarded(self)
- test_out_of_scope_bucket_a_deny_forwarded · method · L201-L210 — def test_out_of_scope_bucket_a_deny_forwarded(self)
- test_bash_denied_for_bucket_a_forwarded · method · L212-L220 — def test_bash_denied_for_bucket_a_forwarded(self)
- LauncherStubSkipOrderingTest · class · L223-L235 — class LauncherStubSkipOrderingTest(unittest.TestCase)
- test_py_stub_python3_real · method · L226-L235 — def test_py_stub_python3_real(self)
- LauncherPyDashThreeArgTest · class · L238-L261 — class LauncherPyDashThreeArgTest(unittest.TestCase)
- test_py_invoked_with_dash_three · method · L241-L261 — def test_py_invoked_with_dash_three(self)
- LauncherSelfResolveTest · class · L264-L298 — class LauncherSelfResolveTest(unittest.TestCase)
- test_claude_plugin_root_unset · method · L268-L275 — def test_claude_plugin_root_unset(self)
- test_plugin_path_with_spaces · method · L277-L298 — def test_plugin_path_with_spaces(self): # Copy the launcher + guard into a path containing spaces, run from there.
- LauncherGuardBrokeTest · class · L301-L360 — class LauncherGuardBrokeTest(unittest.TestCase)
- _run_with_broken_guard · method · L309-L316 — def _run_with_broken_guard(self, guard_body)
- test_guard_exits_nonzero · method · L318-L322 — def test_guard_exits_nonzero(self)
- test_guard_prints_nothing · method · L324-L328 — def test_guard_prints_nothing(self)
- test_guard_prints_invalid_json · method · L330-L334 — def test_guard_prints_invalid_json(self)
- test_guard_prints_substring_not_json · method · L336-L345 — def test_guard_prints_substring_not_json(self)
- test_guard_script_missing · method · L347-L360 — def test_guard_script_missing(self): # A plugin layout with the launcher but NO scripts/ars_write_scope_guard.py: the # launcher resolves a guard path that doesn't exist -> the run_bounded exec fails -> # broken-path degrade. Build the layout, then delete the guard the helper planted.
- LauncherHangingCandidateTest · class · L363-L397 — class LauncherHangingCandidateTest(unittest.TestCase)
- test_hanging_py_then_real_python3 · method · L367-L377 — def test_hanging_py_then_real_python3(self)
- test_hanging_py_killed_via_watchdog_path · method · L379-L397 — def test_hanging_py_killed_via_watchdog_path(self)
- LauncherWatchdogRobustnessTest · class · L400-L442 — class LauncherWatchdogRobustnessTest(unittest.TestCase)
- test_mktemp_failure_degrades_to_passthrough_not_fail_open · method · L404-L424 — def test_mktemp_failure_degrades_to_passthrough_not_fail_open(self)
- test_fast_guard_not_falsely_timed_out_on_watchdog_path · method · L426-L442 — def test_fast_guard_not_falsely_timed_out_on_watchdog_path(self)
- LauncherInfraProtectionTest · class · L445-L463 — class LauncherInfraProtectionTest(unittest.TestCase)
- test_subagent_write_to_launcher_denied · method · L449-L463 — def test_subagent_write_to_launcher_denied(self)