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

Classes

class  TestBranchExists
class  TestCreateBranch
class  TestSwitchBranch
class  TestCreateAndSwitchBranch
class  TestListBranches

Functions

None _commit_file (Path repo, str name, str content, str msg)

Detailed Description

Purpose
-------
Validate the branch mutation primitives in ``oct.core.git`` added in
Phase 4F (G-F1): ``create_branch``, ``switch_branch``,
``create_and_switch_branch``, ``branch_exists``, and ``list_branches``.

Responsibilities
----------------
- Confirm branch creation, switching, and atomic create-and-switch.
- Confirm ``branch_exists`` returns correct booleans.
- Confirm ``list_branches`` returns local (and optionally remote) names.
- Confirm error cases raise ``GitCommandError``.

Diagnostics
-----------
Domain: CORE-TESTS
Levels:
    L2 -- test lifecycle
    L3 -- per-case setup
    L4 -- fine-grained assertions

Contracts
---------
- Tests never write outside of ``tmp_path`` / pytest-managed temp dirs.
- Tests that require a real ``git`` binary are skipped via the
  ``git_repo`` fixture when git is missing.

Function Documentation

◆ _commit_file()

None tests_core.test_git_branch._commit_file ( Path repo,
str name,
str content,
str msg )
protected
Write a file, stage it, and commit it.

Definition at line 50 of file test_git_branch.py.

Here is the caller graph for this function: