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

Classes

class  TestMonorepoPathResolution
class  TestDeduplication

Functions

bool _git_available ()
subprocess.CompletedProcess _git (Path repo, *str args, bool check=True)
subprocess.CompletedProcess _run_status (Path project_dir, *str extra_args)
tuple[Path, Path] monorepo_project (Path tmp_path)

Variables

 _COMPLIANT_TEMPLATE = textwrap.dedent()

Detailed Description

Purpose
-------
Integration tests for ``oct git status`` in monorepo layouts where the
git repo root differs from the OCT project root.

Responsibilities
----------------
- Verify that ``oct git status`` resolves file paths correctly when
  the OCT project lives in a subdirectory of the git repo.
- Verify that no false "File too short" or "Missing module docstring"
  warnings appear on well-formed files.
- Verify that files outside the project scope are excluded.
- Verify that duplicate entries do not appear across staged/modified
  sections.

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

Contracts
---------
- Every test uses the ``monorepo_project`` fixture.
- Tests never modify the system git config.

Function Documentation

◆ _git()

subprocess.CompletedProcess tests_git.test_git_status_monorepo._git ( Path repo,
*str args,
bool check = True )
protected
Run a git command inside *repo*.

Definition at line 54 of file test_git_status_monorepo.py.

Here is the caller graph for this function:

◆ _git_available()

bool tests_git.test_git_status_monorepo._git_available ( )
protected

Definition at line 50 of file test_git_status_monorepo.py.

Here is the caller graph for this function:

◆ _run_status()

subprocess.CompletedProcess tests_git.test_git_status_monorepo._run_status ( Path project_dir,
*str extra_args )
protected
Run ``oct git status`` from inside the OCT project subdirectory.

Definition at line 67 of file test_git_status_monorepo.py.

Here is the caller graph for this function:

◆ monorepo_project()

tuple[Path, Path] tests_git.test_git_status_monorepo.monorepo_project ( Path tmp_path)
Create a monorepo where the OCT project is a subdirectory.

Layout::

    <git_root>/
    ├── .git/
    ├── other_project/
    │   └── README.md
    └── subproject/            ← OCT project root
        ├── .option_c/
        ├── .octrc.json
        ├── oc_diagnostics/
        ├── docs/
        │   └── ARCHITECTURE.md
        ├── logs/
        ├── src/
        ├── tests/
        └── pyproject.toml

Returns ``(git_root, project_root)`` where ``project_root`` is
``git_root / "subproject"``.

The project directory is named ``subproject`` (not ``oct``) so that
running ``python -m oct.cli`` in a subprocess does not shadow the
installed ``oct`` package.

Definition at line 120 of file test_git_status_monorepo.py.

Here is the call graph for this function:

Variable Documentation

◆ _COMPLIANT_TEMPLATE

tests_git.test_git_status_monorepo._COMPLIANT_TEMPLATE = textwrap.dedent()
protected

Definition at line 79 of file test_git_status_monorepo.py.