|
Option C Tools
|
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() | |
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.
|
protected |
Run a git command inside *repo*.
Definition at line 54 of file test_git_status_monorepo.py.
|
protected |
Definition at line 50 of file test_git_status_monorepo.py.
|
protected |
Run ``oct git status`` from inside the OCT project subdirectory.
Definition at line 67 of file test_git_status_monorepo.py.
| 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.
|
protected |
Definition at line 79 of file test_git_status_monorepo.py.