Option C Tools
Loading...
Searching...
No Matches
tests_docs.test_docs_clean Namespace Reference

Functions

Path docs_tree (Path tmp_path)
 test_clean_removes_generated_dirs (Path docs_tree)
 test_clean_removes_generated_files (Path docs_tree)
 test_clean_preserves_user_content (Path docs_tree)
 test_clean_preserves_sphinx_config (Path docs_tree)
 test_clean_preserves_static (Path docs_tree)
 test_clean_preserves_doxyfile (Path docs_tree)
 test_dry_run_preserves_everything (Path docs_tree)
 test_no_docs_dir (Path tmp_path)
 test_already_clean (Path docs_tree)

Detailed Description

Purpose
-------
Validate the ``oct docs --clean`` pipeline (run_docs_clean).

Responsibilities
----------------
- Confirm generated directories (html, doctrees, _api, doxygen_output) are removed.
- Confirm generated files (index.rst, dependencies.rst) are removed.
- Confirm preserved files (_sphinx/conf.py, _static/, user-authored .md) survive.
- Confirm dry-run mode does not delete anything.
- Confirm running on a project with no docs/ is a no-op.

Diagnostics
-----------
Domain: DOCS-TESTS
L2: test lifecycle
L3: assertion details
L4: deep tracing

Contracts
---------
Inputs:  tmp_path pytest fixture
Outputs: pass/fail assertions

Function Documentation

◆ docs_tree()

Path tests_docs.test_docs_clean.docs_tree ( Path tmp_path)
Create a realistic docs/ directory with generated and user-authored files.

Definition at line 37 of file test_docs_clean.py.

◆ test_already_clean()

tests_docs.test_docs_clean.test_already_clean ( Path docs_tree)
Running clean twice is idempotent.

Definition at line 143 of file test_docs_clean.py.

◆ test_clean_preserves_doxyfile()

tests_docs.test_docs_clean.test_clean_preserves_doxyfile ( Path docs_tree)
Doxyfile in doxygen_work_dir/ survives clean.

Definition at line 115 of file test_docs_clean.py.

◆ test_clean_preserves_sphinx_config()

tests_docs.test_docs_clean.test_clean_preserves_sphinx_config ( Path docs_tree)
Sphinx config directory (_sphinx/) survives clean.

Definition at line 103 of file test_docs_clean.py.

◆ test_clean_preserves_static()

tests_docs.test_docs_clean.test_clean_preserves_static ( Path docs_tree)
Static assets directory (_static/) survives clean.

Definition at line 109 of file test_docs_clean.py.

◆ test_clean_preserves_user_content()

tests_docs.test_docs_clean.test_clean_preserves_user_content ( Path docs_tree)
User-authored markdown files survive clean.

Definition at line 95 of file test_docs_clean.py.

◆ test_clean_removes_generated_dirs()

tests_docs.test_docs_clean.test_clean_removes_generated_dirs ( Path docs_tree)
Generated directories (html, doctrees, _api, doxygen_output) are removed.

Definition at line 75 of file test_docs_clean.py.

◆ test_clean_removes_generated_files()

tests_docs.test_docs_clean.test_clean_removes_generated_files ( Path docs_tree)
Generated files (index.rst, dependencies.rst) are removed.

Definition at line 86 of file test_docs_clean.py.

◆ test_dry_run_preserves_everything()

tests_docs.test_docs_clean.test_dry_run_preserves_everything ( Path docs_tree)
Dry-run mode reports but does not delete anything.

Definition at line 121 of file test_docs_clean.py.

◆ test_no_docs_dir()

tests_docs.test_docs_clean.test_no_docs_dir ( Path tmp_path)
No docs/ directory — clean is a no-op.

Definition at line 135 of file test_docs_clean.py.