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

Classes

class  TestBranchCreate
class  TestBranchSwitch
class  TestMutualExclusivity

Functions

bool _git_available ()
subprocess.CompletedProcess _run_branch (Path root, *str extra_args)
dict _run_branch_json (Path root, *str extra_args)

Detailed Description

Purpose
-------
Integration tests for ``oct git branch`` (Phase 4F — G-F1).

Responsibilities
----------------
- Verify ``--create`` creates a branch with naming validation.
- Verify ``--switch`` switches to an existing branch.
- Verify mutual exclusivity of ``--create`` and ``--switch``.
- Verify JSON output.
- Verify audit trail.
- Verify error cases (duplicate, non-existent, uncommitted changes).

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_commit.py).
- All tests use tmp_path fixtures so they are automatically cleaned up.

Function Documentation

◆ _git_available()

bool tests_git.test_git_branch._git_available ( )
protected

Definition at line 49 of file test_git_branch.py.

◆ _run_branch()

subprocess.CompletedProcess tests_git.test_git_branch._run_branch ( Path root,
*str extra_args )
protected
Run ``oct git branch`` in a subprocess.

Definition at line 53 of file test_git_branch.py.

Here is the caller graph for this function:

◆ _run_branch_json()

dict tests_git.test_git_branch._run_branch_json ( Path root,
*str extra_args )
protected
Run ``oct git branch --json`` and parse JSON output.

Definition at line 63 of file test_git_branch.py.

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