Option C Tools
Loading...
Searching...
No Matches
tests_scaffold.test_run_scaffold Namespace Reference

Functions

 test_dry_run_creates_nothing (Path tmp_path)
 test_scaffold_creates_core_directories (Path tmp_path)
 test_scaffold_writes_debug_config_and_octrc (Path tmp_path)
 test_scaffold_writes_gitignore_with_venv (Path tmp_path)
 test_scaffold_is_idempotent (Path tmp_path)
 test_scaffold_result_is_dataclass (Path tmp_path)

Detailed Description

Purpose
-------
OI-512 / FS-518 regression coverage — :func:`oct.scaffold.run_scaffold`
must materialise the full Option C project skeleton (directories, bundled
files, ``.gitignore`` / ``.octignore`` entries including ``.venv/``) and
behave idempotently (already-present paths land in ``skipped`` rather
than being overwritten). ``dry_run=True`` must be strictly side-effect
free.

The ``include_venv`` flag and its health-warning companion are covered
in :mod:`test_scaffold_venv`.

Responsibilities
----------------
- Verify full skeleton materialisation (directories and bundled files).
- Verify idempotent re-runs land existing paths in ``skipped``.
- Verify ``dry_run=True`` produces no filesystem side-effects.

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

Contracts
---------
- ``dry_run=True`` → no filesystem changes; messages populated.
- All documented files appear in ``result.created`` on first run.
- A second ``run_scaffold`` call on the same directory creates nothing
  new and produces no duplicate-file errors.

Function Documentation

◆ test_dry_run_creates_nothing()

tests_scaffold.test_run_scaffold.test_dry_run_creates_nothing ( Path tmp_path)
OI-512: dry_run emits plan messages and never touches the disk.

Definition at line 49 of file test_run_scaffold.py.

◆ test_scaffold_creates_core_directories()

tests_scaffold.test_run_scaffold.test_scaffold_creates_core_directories ( Path tmp_path)
FS-539: docs/, tests/, .option_c/, .option_c/logs/ all appear.

Definition at line 58 of file test_run_scaffold.py.

◆ test_scaffold_is_idempotent()

tests_scaffold.test_run_scaffold.test_scaffold_is_idempotent ( Path tmp_path)
OI-512: a second run must skip everything, not overwrite.

Definition at line 100 of file test_run_scaffold.py.

◆ test_scaffold_result_is_dataclass()

tests_scaffold.test_run_scaffold.test_scaffold_result_is_dataclass ( Path tmp_path)
OI-512: the return type must be a ScaffoldResult with the documented fields.

Definition at line 112 of file test_run_scaffold.py.

◆ test_scaffold_writes_debug_config_and_octrc()

tests_scaffold.test_run_scaffold.test_scaffold_writes_debug_config_and_octrc ( Path tmp_path)
FS-539: debug_config + octrc land under .option_c/ with expected shape.

Definition at line 74 of file test_run_scaffold.py.

◆ test_scaffold_writes_gitignore_with_venv()

tests_scaffold.test_run_scaffold.test_scaffold_writes_gitignore_with_venv ( Path tmp_path)
FS-503 / FS-504: .gitignore and .octignore both include .venv/.

Definition at line 87 of file test_run_scaffold.py.