Option C Tools
Loading...
Searching...
No Matches
tests_git.test_git_hooks Namespace Reference

Classes

class  TestHooksInstall
class  TestHooksStatus
class  TestHooksRemove
class  TestDeprecationShim
class  TestAuditTrail

Functions

bool _git_available ()
 _git (Path repo, *str args, bool check=True)
subprocess.CompletedProcess _run_hooks (Path root, *str extra_args)
subprocess.CompletedProcess _run_install_hooks (Path root, *str extra_args)
Path _make_option_c_git_project (Path tmp_path, str name="hookproj")

Detailed Description

Purpose
-------
Integration tests for ``oct git hooks`` subgroup (Phase 4D — G-D8..G-D11).

Responsibilities
----------------
- Verify ``oct git hooks install`` creates .pre-commit-config.yaml.
- Verify ``oct git hooks status`` reports correct hook states.
- Verify ``oct git hooks remove`` removes OCT hooks.
- Verify deprecation shim for ``oct install-hooks``.

Diagnostics
-----------
Domain: GIT-TESTS
Levels:
    L2 — test lifecycle
    L3 — assertion details
    L4 — deep tracing

Contracts
---------
- All tests use subprocess invocation and tmp_path fixtures.

Function Documentation

◆ _git()

tests_git.test_git_hooks._git ( Path repo,
*str args,
bool check = True )
protected

Definition at line 48 of file test_git_hooks.py.

Here is the caller graph for this function:

◆ _git_available()

bool tests_git.test_git_hooks._git_available ( )
protected

Definition at line 44 of file test_git_hooks.py.

◆ _make_option_c_git_project()

Path tests_git.test_git_hooks._make_option_c_git_project ( Path tmp_path,
str name = "hookproj" )
protected
Create a git repo with Option C project structure.

Definition at line 78 of file test_git_hooks.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _run_hooks()

subprocess.CompletedProcess tests_git.test_git_hooks._run_hooks ( Path root,
*str extra_args )
protected
Run ``oct git hooks <subcmd>`` in a subprocess.

Definition at line 58 of file test_git_hooks.py.

Here is the caller graph for this function:

◆ _run_install_hooks()

subprocess.CompletedProcess tests_git.test_git_hooks._run_install_hooks ( Path root,
*str extra_args )
protected
Run the deprecated ``oct install-hooks``.

Definition at line 68 of file test_git_hooks.py.

Here is the caller graph for this function: