Option C Tools
Loading...
Searching...
No Matches
tests_install.test_oct_install Namespace Reference

Classes

class  TestPreflightNotOcProject
class  TestPreflightWorktree
class  TestPreflightVenv
class  TestPreflightShadow
class  TestSuccessPath
class  TestEditableRequired

Functions

Path _make_oc_project (Path root, str name="myproj")
Path _make_venv (Path root)
bool _is_windows ()

Detailed Description

Purpose
-------
Validate the B1.4 ``oct install --editable`` safety wrapper. The
heart of the command is the preflight matrix; the actual ``pip
install -e`` subprocess is mocked because we don't want test runs to
mutate the real venv's site-packages.

Responsibilities
----------------
- Cover each preflight refusal: not-an-Option-C-project, inside a
  worktree, wrong venv, existing shadow install.
- Cover each override flag (--allow-worktree, --use-active-venv,
  --reinstall, --allow-outside-project).
- Cover the success path (preflights green, pip mocked to exit 0,
  post-install diagnostics printed).
- Cover the JSON output schema for both refusal and success.

Diagnostics
-----------
Domain: GIT-TESTS
Levels:
    L2 -- test lifecycle
    L3 -- assertion details

Contracts
---------
- Tests use ``CliRunner`` from Click rather than spawning a
  subprocess. This lets us monkey-patch the subprocess call cleanly.
- Tests must not modify the developer's actual venv. Every
  ``subprocess.run`` is patched to a stub that returns
  ``returncode=0`` without performing any work.

Function Documentation

◆ _is_windows()

bool tests_install.test_oct_install._is_windows ( )
protected

Definition at line 77 of file test_oct_install.py.

Here is the caller graph for this function:

◆ _make_oc_project()

Path tests_install.test_oct_install._make_oc_project ( Path root,
str name = "myproj" )
protected
Create the minimum-marker Option C project layout.

Definition at line 54 of file test_oct_install.py.

Here is the caller graph for this function:

◆ _make_venv()

Path tests_install.test_oct_install._make_venv ( Path root)
protected
Create a venv-shaped directory (just the markers we look at).

Definition at line 67 of file test_oct_install.py.

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