|
Option C Tools
|
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") |
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.
|
protected |
|
protected |
Definition at line 46 of file test_git_init.py.
|
protected |
Create an Option C project inside a real git repo with one commit.
Definition at line 88 of file test_git_init.py.
|
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.
|
protected |
Run ``oct git init`` in a subprocess with *root* as cwd.
Definition at line 60 of file test_git_init.py.