Orchestrata Ultimate › Tests › Reference › claude › test_gen_plugin

Tests reference — tests/claude/test_gen_plugin.py

Module of tests/claude, split out because the directory page would be too large.

Prose pending.

tests/claude/test_gen_plugin.py

source · 35 tests · 736 lines

Tests for claude/scripts/gen_plugin.py — the generator that derives the

Kind Name Line Description
function test_hook_command_count_matches_declaration 54
function test_no_literal_claude_home_path_in_generated_hooks 92
function test_rewrite_preserves_python3_interpreter 105
function test_rewrite_preserves_trailing_arguments 112
function test_rewrite_bare_script_no_interpreter 121
function test_rewrite_leaves_unrewritable_command_untouched 128 A command whose script path is NOT under /home/mohamed/.claude must be
function test_rewrite_over_real_declaration_touches_only_claude_home_paths 143 Every command in the real declaration either gets its /home/mohamed/.claude
function test_plugin_manifest_has_required_and_declared_fields 165
function test_marketplace_has_required_fields 174
function test_check_fails_before_generation_and_passes_after 188
function test_check_detects_stale_manifest_after_hand_edit 199
function test_check_reports_changed_component_file 215 A mirrored file whose CONTENT was hand-edited (not removed) is drift too.
function test_build_hooks_document_skips_non_dict_blocks 238 A malformed (non-dict) block in an event's list is skipped, not crashed on.
function test_prune_empty_dirs_on_nonexistent_directory_is_a_noop 252
function test_component_file_counts_match_the_real_claude_tree 261 Counts must be preserved exactly: 54 hooks, 14 commands, 7 agents,
function test_sync_mirrors_every_component_into_the_plugin 374
function test_component_drift_detects_a_file_added_to_source 395 A file added under the source directory and not yet mirrored is drift --
function test_component_drift_detects_an_orphaned_dest_file 417
function test_component_drift_detects_changed_content 431
function test_component_drift_detects_a_mode_change_with_identical_content 443 The executable bit is part of what the mirror must reproduce.
function test_sync_component_restores_the_executable_bit 472 Detecting the drift is only half; the sync must actually fix it.
function test_component_drift_ignores_generated_only_paths 491 hooks.json lives inside the mirrored hooks/ directory but is not a
function test_sync_component_removes_orphans_and_prunes_empty_dirs 507
function test_sync_component_deletes_bytecode_caches_in_the_mirror 520 pycache is invisible to orphan detection (excluded from the walk
function test_check_reports_drift_for_a_file_removed_after_generation 540
function test_sync_regenerates_a_removed_file 551
function test_sync_removes_an_orphan_left_in_the_plugin 564
function test_exclude_keeps_a_matching_source_file_unmirrored_and_not_missing 584 An excluded file in source is neither mirrored into dest nor reported
function test_exclude_matches_a_nested_dot_terraform_directory_by_component_name 609 .terraform excludes an entire nested provider-binary tree, not
function test_exclude_reports_an_already_mirrored_excluded_file_as_orphan_and_removes_it 632 Fail-safe direction: exclusion applies ONLY to the source walk. A file
function test_exclude_log_glob_excludes_rehearsal_timings_log 657 The rehearsal component's *.log pattern excludes
function test_secret_shaped_env_file_never_enters_the_mirror 672 .env* files are excluded from EVERY component's source walk with no
function test_plugin_top_level_is_exactly_the_owned_set 698 Every top-level entry in the COMMITTED mirror belongs to a component
function test_tools_keep_their_name_so_plugin_root_resolution_works 708 Five hooks resolve ${CLAUDE_PLUGIN_ROOT}/tools/<x>.py and
function test_regen_prunes_an_unowned_top_level_directory 721 A directory under the plugin root that no component owns is pruned by