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

Classes

class  TestInitFresh
class  TestIdempotent
class  TestGitignoreMerge
class  TestGitattributesMerge
class  TestDryRun
class  TestNoHooks
class  TestGitHub
class  TestAuditTrail

Functions

bool _git_available ()
 _git (Path repo, *str args, bool check=True)
subprocess.CompletedProcess _run_init (Path root, *str extra_args)
Path _make_option_c_dir (Path tmp_path, str name="fresh")
Path _make_git_project (Path tmp_path, str name="existing")

Detailed Description

Purpose
-------
Integration tests for ``oct git init`` (Phase 4C — G-C1/G-C3).

Responsibilities
----------------
- Verify init bootstraps a git repo on a bare directory.
- Verify .gitignore merge logic (append-only, no duplicates).
- Verify .gitattributes creation and merge.
- Verify --dry-run, --no-hooks, --github flags.
- Verify idempotent re-runs.
- Verify audit trail is written.

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

Contracts
---------
- All tests use tmp_path so they are automatically cleaned up.

Function Documentation

◆ _git()

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

Definition at line 50 of file test_git_init.py.

Here is the caller graph for this function:

◆ _git_available()

bool tests_git.test_git_init._git_available ( )
protected

Definition at line 46 of file test_git_init.py.

◆ _make_git_project()

Path tests_git.test_git_init._make_git_project ( Path tmp_path,
str name = "existing" )
protected
Create an Option C project inside a real git repo with one commit.

Definition at line 88 of file test_git_init.py.

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

◆ _make_option_c_dir()

Path tests_git.test_git_init._make_option_c_dir ( Path tmp_path,
str name = "fresh" )
protected
Create a directory with minimal Option C project structure.

Includes docs/, tests/, oc_diagnostics/ so find_project_root works.

Definition at line 70 of file test_git_init.py.

Here is the caller graph for this function:

◆ _run_init()

subprocess.CompletedProcess tests_git.test_git_init._run_init ( Path root,
*str extra_args )
protected
Run ``oct git init`` in a subprocess with *root* as cwd.

Definition at line 60 of file test_git_init.py.

Here is the caller graph for this function: