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

Classes

class  TestExitCodes
class  TestSecretsNonBypassable
class  TestForce
class  TestNoVerify
class  TestProtectedBranch
class  TestLargeFile
class  TestConventionalMessage
class  TestAuditTrail
class  TestJsonOutput
class  TestRepeatedMessage

Functions

bool _git_available ()
subprocess.CompletedProcess _run_commit (Path root, *str extra_args)
dict _run_commit_json (Path root, *str extra_args)
dict|None _latest_audit_record (Path root)

Detailed Description

Purpose
-------
Integration tests for ``oct git commit`` (Phase 4D — G-D3, G-D4, G-D6, G-D7).

Responsibilities
----------------
- Verify exit codes 0-4 for commit scenarios.
- Verify the non-bypassable secrets invariant (G-D4).
- Verify --force, --no-verify, --json flags.
- Verify protected-branch guards (G-D7).
- Verify large-file advisory warnings (G-D6).
- Verify audit trail.

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

Contracts
---------
- All tests use subprocess invocation (same pattern as test_git_check.py).
- All tests use tmp_path fixtures so they are automatically cleaned up.

Function Documentation

◆ _git_available()

bool tests_git.test_git_commit._git_available ( )
protected

Definition at line 49 of file test_git_commit.py.

◆ _latest_audit_record()

dict | None tests_git.test_git_commit._latest_audit_record ( Path root)
protected
Read the last JSONL line from the newest audit file.

Definition at line 69 of file test_git_commit.py.

Here is the caller graph for this function:

◆ _run_commit()

subprocess.CompletedProcess tests_git.test_git_commit._run_commit ( Path root,
*str extra_args )
protected
Run ``oct git commit`` in a subprocess.

Definition at line 53 of file test_git_commit.py.

Here is the caller graph for this function:

◆ _run_commit_json()

dict tests_git.test_git_commit._run_commit_json ( Path root,
*str extra_args )
protected
Run ``oct git commit --json`` and parse JSON output.

Definition at line 63 of file test_git_commit.py.

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