Orchestrata Ultimate › Tests › Reference › session › test_session_hooks_coverage

Tests reference — tests/session/test_session_hooks_coverage.py

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

Prose pending.

tests/session/test_session_hooks_coverage.py

source · 28 tests · 566 lines

Coverage-focused tests for session_auto_start_hook and session_pre_close_hook.

Covers: session.context, session.hooks.session_auto_start_hook, session.hooks.session_pre_close_hook, session.session

Kind Name Line Description
function test_read_hook_input_valid_json 85
function test_read_hook_input_empty_stdin 96
function test_read_hook_input_invalid_json 106
function test_read_hook_input_partial_keys 116 JSON with only 'source' falls back to default cwd.
function test_detect_auto_closed_session_when_unclosed 132
function test_detect_auto_closed_session_returns_none_when_closed 146
function test_detect_auto_closed_session_no_history 156
function test_detect_auto_closed_session_handles_missing_context 164 A controller pointed at a non-Orchestrata dir produces None safely.
function test_build_session_output_no_auto_closed 180
function test_build_session_output_with_auto_closed 193
function test_build_session_output_with_carryover_attribute 210 Even when ContextData has no 'carryover' attribute the function works.
function test_auto_start_main_skips_non_orchestrata 226
function test_auto_start_main_resume_source 241
function test_auto_start_main_starts_new_session 256
function test_auto_start_main_with_packages_dir 274 Project lacks context.md but has packages/ — should still be detected.
function test_auto_start_main_auto_closes_previous_session 295
function test_auto_start_main_default_cwd_when_no_input 313 Empty stdin → uses '.' as cwd, which is normally not Orchestrata.
function test_run_tests_returns_true_when_pytest_passes 339 run_tests succeeds when a tiny passing pytest tree is present.
function test_run_tests_returns_false_when_pytest_fails 357
function test_run_tests_handles_missing_uv 371 When uv cannot be found in PATH, run_tests returns False (not raise).
function test_check_git_clean_returns_true_when_git_missing 385
function test_pre_close_main_non_orchestrata_allows_close 399
function test_pre_close_main_empty_stdin_uses_dot 414 Empty stdin defaults cwd='.', which from a temp dir is not Orchestrata.
function test_pre_close_main_invalid_json_uses_dot 434
function test_pre_close_main_implementation_dir_only 453 Project with implementation/ but no context.md — main proceeds and
function test_pre_close_main_with_orchestrata_project_emits_failures 474 With a context-only project (no active session, no tests, no git),
function test_pre_close_main_complete_session_passes 497 A fully-populated session in a clean git repo with passing tests
function test_validate_checklist_partial_session 554 A session with only work logged still reports remaining failures.