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

Classes

class  TestAddSingleFile
class  TestAddMultipleFiles
class  TestAddUpdate
class  TestAddAll
class  TestAddDryRun
class  TestAddOutsideProjectScope
class  TestAddJson
class  TestAddMutualExclusivity
class  TestAddNoOp
class  TestAddIgnoredDirWarning
class  TestAddAudit

Functions

bool _git_available ()
subprocess.CompletedProcess _run_add (Path root, *str extra_args)
list[str] _staged_names (Path repo)

Detailed Description

Purpose
-------
Integration tests for ``oct git add`` (Phase 4G).

Responsibilities
----------------
- Verify whole-file staging stages the requested paths.
- Verify ``--update`` and ``--all`` behave like ``git add -u`` / ``-A``.
- Verify ``--dry-run`` does not modify the index.
- Verify ``--patch`` constructs the correct argv (passthrough is mocked).
- Verify mutual exclusivity rules.
- Verify JSON output schema.
- Verify the post-stage quality gate advisory.

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

Contracts
---------
- All tests use subprocess invocation against ``oct.cli``.
- All tests use tmp_path fixtures so they are automatically cleaned up.

Function Documentation

◆ _git_available()

bool tests_git.test_git_add._git_available ( )
protected

Definition at line 45 of file test_git_add.py.

◆ _run_add()

subprocess.CompletedProcess tests_git.test_git_add._run_add ( Path root,
*str extra_args )
protected
Run ``oct git add`` in a subprocess.

Definition at line 49 of file test_git_add.py.

Here is the caller graph for this function:

◆ _staged_names()

list[str] tests_git.test_git_add._staged_names ( Path repo)
protected
Return file names currently staged (index).

Definition at line 59 of file test_git_add.py.

Here is the caller graph for this function: