Orchestrata Ultimate › Tests › Reference › scripts › test_provision_worktree_env

Tests reference — tests/scripts/test_provision_worktree_env.py

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

Prose pending.

tests/scripts/test_provision_worktree_env.py

source · 16 tests · 220 lines

Kind Name Line Description
function test_current_worktree_is_the_worktree_we_stand_in 78
function test_current_worktree_is_none_outside_a_repository 82
function test_primary_worktree_is_found_from_a_linked_one 88 git worktree list --porcelain emits the primary first. Derived, not guessed
function test_primary_worktree_of_the_primary_is_itself 94
function test_copies_env_from_the_primary_worktree 101
function test_copied_env_is_owner_readable_only 113 It carries credentials. 0600, not whatever umask happened to be set.
function test_existing_env_is_left_alone 120 Idempotent, and non-destructive: a worktree that already has a customised
function test_force_overwrites_an_existing_env 132
function test_reports_failure_when_no_source_exists 142 No .env in the primary and no decryptable ciphertext. The script must say so
function test_no_copy_when_the_worktree_is_the_primary 153 Copying a file onto itself would truncate it. The guard is
function test_no_temp_file_is_left_behind 167 The copy goes through <name>.provision.tmp + os.replace so an interrupted
function test_cli_succeeds_and_is_idempotent 178
function test_provisioning_failure_still_exits_zero 188 Deliberate, and load-bearing: this runs from git's post-checkout hook, so a
function test_check_mode_exits_missing_without_provisioning 197
function test_check_mode_exits_ok_when_env_is_present 204
function test_explicit_worktree_path_is_trusted_not_revalidated 209 --worktree is taken as given: `worktree = current_worktree(start) if start is