Orchestrata Ultimate › Tests › Reference › scripts › test_check_external_tools
Tests reference — tests/scripts/test_check_external_tools.py
Module of tests/scripts, split out because the directory page would be too large.
Prose pending.
tests/scripts/test_check_external_tools.py
source · 75 tests · 926 lines
Tests for scripts/check_external_tools.py — the external-tools gate.
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_parse_version_extracts_dotted_number_from_free_text |
76 | |
| function | test_parse_version_handles_a_bare_number |
80 | |
| function | test_parse_version_raises_without_a_dotted_number |
84 | |
| function | test_version_at_least_is_numeric_not_lexicographic |
89 | The classic string-compare bug: "1.10.0" sorts BELOW "1.9.0" as a |
| function | test_version_at_least_pads_unequal_length_tuples |
98 | |
| function | test_load_declared_tools_parses_a_valid_table |
109 | |
| function | test_load_declared_tools_parses_multiple_entries |
122 | |
| function | test_load_declared_tools_raises_gate_error_without_a_pyproject |
132 | |
| function | test_load_declared_tools_raises_gate_error_on_malformed_toml |
139 | |
| function | test_load_declared_tools_raises_when_entry_missing_min_version |
148 | |
| function | test_load_declared_tools_raises_when_entry_missing_install |
156 | |
| function | test_load_declared_tools_raises_when_min_version_is_unparseable |
164 | |
| function | test_load_declared_tools_raises_when_entry_is_not_a_table |
174 | |
| function | test_load_declared_tools_raises_when_external_tools_is_not_a_table |
182 | |
| function | test_load_declared_tools_returns_empty_dict_for_an_absent_subtable |
191 | |
| function | test_load_project_script_names_reads_the_project_scripts_table |
205 | A DIFFERENT, made-up script name than any real console script this |
| function | test_load_project_script_names_returns_empty_frozenset_for_an_absent_table |
220 | |
| function | test_load_project_script_names_raises_when_scripts_is_not_a_table |
227 | |
| function | test_load_project_script_names_matches_the_live_console_scripts |
235 | Against the REAL pyproject.toml: both console scripts this gate used |
| function | test_load_excluded_dirs_reads_ruff_extend_exclude |
250 | |
| function | test_load_excluded_dirs_returns_empty_frozenset_when_ruff_table_absent |
259 | |
| function | test_load_excluded_dirs_raises_when_extend_exclude_is_not_a_list |
266 | |
| function | test_load_excluded_dirs_matches_the_live_vendored_janus_exclusion |
274 | Against the REAL pyproject.toml: scripts/_janus_patched (the vendored |
| function | test_probe_tool_with_version_stdin_for_repl_tools |
297 | The live CLIPS declaration drives this: version_stdin="(exit) |
| function | test_probe_tool_passes_when_present_and_new_enough |
314 | |
| function | test_probe_tool_handles_the_bare_age_style_version_output |
324 | |
| function | test_probe_tool_fails_below_min_version_and_names_the_install_command |
335 | |
| function | test_probe_tool_uses_numeric_comparison_not_string |
346 | 1.10.0 must satisfy a declared minimum of 1.9.0 — a string compare |
| function | test_probe_tool_fails_when_absent_from_path |
356 | |
| function | test_probe_tool_fails_when_version_output_has_no_number |
366 | |
| function | test_probe_tool_handles_a_binary_that_fails_to_execute |
377 | An empty file with the executable bit set is found on PATH but the |
| function | test_scan_repo_flags_an_undeclared_literal_list_invocation |
399 | |
| function | test_scan_repo_treats_a_plain_string_command_as_its_first_token |
413 | |
| function | test_scan_repo_allows_the_allowlisted_git_invocation |
424 | |
| function | test_scan_repo_treats_a_declared_tool_as_satisfied |
434 | |
| function | test_scan_repo_skips_and_counts_non_literal_argv |
445 | |
| function | test_scan_repo_ignores_the_tests_directory |
457 | |
| function | test_scan_repo_ignores_sys_executable_without_counting_it_skipped |
467 | |
| function | test_scan_repo_ignores_generated_build_directories |
480 | |
| function | test_scan_repo_skips_a_path_under_an_excluded_dir |
489 | The direction-5 classification: a vendored/excluded tree (modelled |
| function | test_scan_repo_still_scans_an_undeclared_sibling_of_an_excluded_dir |
501 | Prefix-boundary check: excluding scripts/_vendored must not also |
| function | test_scan_repo_excludes_the_live_vendored_janus_patch_tree |
514 | Against the REAL repo: once the real [tool.ruff] extend-exclude list |
| function | test_find_undeclared_treats_a_declared_console_script_as_satisfied |
523 | A made-up console-script name (never hard-coded anywhere in the gate) |
| function | test_find_undeclared_still_flags_a_name_absent_from_every_tier |
540 | |
| function | test_find_undeclared_allows_a_posix_baseline_invocation |
554 | A POSIX-baseline tool (rm) never needs a table entry. |
| function | test_find_undeclared_allows_a_venv_resolved_python_tool |
564 | A venv-resolved Python tool (ruff) already gated by check-deps as a |
| function | test_scan_file_ignores_a_syntactically_broken_file |
575 | |
| function | test_scan_file_ignores_an_unreadable_broken_symlink |
582 | A broken symlink raises OSError on read — must not crash the scan. |
| function | test_scan_repo_matches_popen_args_keyword |
592 | |
| function | test_scan_repo_matches_an_aliased_subprocess_import |
601 | |
| function | test_scan_repo_matches_a_direct_from_import |
610 | |
| function | test_scan_repo_matches_check_output |
619 | |
| function | test_scan_repo_ignores_an_unrelated_dot_run_method |
628 | A .run() call on something that is NOT subprocess must not |
| function | test_scan_repo_ignores_a_call_with_no_resolvable_argv |
643 | |
| function | test_scan_repo_takes_the_basename_of_a_path_like_literal |
653 | |
| function | test_build_report_is_ok_when_nothing_is_wrong |
669 | |
| function | test_build_report_fails_on_missing_or_outdated |
678 | |
| function | test_build_report_fails_on_undeclared_invocation_and_reports_skips |
687 | |
| function | test_print_text_report_prints_a_pass_line |
698 | |
| function | test_print_text_report_prints_fail_lines_and_the_remedy |
709 | |
| function | test_print_text_report_prints_none_declared |
730 | |
| function | test_main_returns_2_on_a_missing_pyproject |
745 | |
| function | test_main_returns_2_on_a_malformed_table |
753 | |
| function | test_main_returns_0_when_everything_is_clean |
762 | |
| function | test_main_returns_1_on_an_undeclared_invocation |
776 | |
| function | test_main_returns_1_on_a_below_min_version_tool |
788 | |
| function | test_main_returns_1_on_a_tool_absent_from_path |
798 | |
| function | test_main_json_output_is_valid_and_matches_the_exit_code |
808 | |
| function | test_main_default_path_reads_the_real_process_path |
820 | Without --path, resolution falls back to the real PATH env var — proved |
| function | test_declared_live_tools_are_present_and_new_enough |
836 | Direction 1 against the REAL table: every declared tool must actually |
| function | test_declared_live_tools_include_the_2026_08_12_classification |
849 | incus/swipl/node were classified as genuine non-PyPI project |
| function | test_main_runs_cleanly_against_the_live_repo |
862 | The gate must read and evaluate its own declaration table over the |
| function | test_main_no_longer_flags_session_or_orchestrata_tools_console_scripts |
879 | Regression proof for the console-script allowlist wiring: session |
| function | test_script_entrypoint_runs_as_a_subprocess_against_the_live_repo |
898 | The gate is invoked as a subprocess by health_check.py / gates.py; |
| function | test_script_entrypoint_json_mode_against_the_live_repo |
913 |