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

Functions

Path isolated_tmp (Path tmp_path, monkeypatch)
None _make_stale (Path path, float age_seconds)
None test_sweep_removes_old_stale_doxyfile (Path isolated_tmp)
None test_sweep_preserves_recent_doxyfile (Path isolated_tmp)
None test_sweep_ignores_unrelated_temp_files (Path isolated_tmp)
None test_sweep_returns_count (Path isolated_tmp)
None test_sweep_handles_unlink_failure_gracefully (Path isolated_tmp, monkeypatch)
None test_sweep_respects_custom_max_age (Path isolated_tmp)
None test_sweep_default_constant_is_one_day ()

Variables

str name = "oct-doxyfile-locked.Doxyfile":

Detailed Description

Purpose
-------
Validate the OI-423 stale Doxyfile sweeper in ``oct.docs.oct_docs``.

Responsibilities
----------------
- Confirm old ``oct-doxyfile-*.Doxyfile`` temp files are removed.
- Confirm recent ``oct-doxyfile-*.Doxyfile`` temp files are preserved.
- Confirm unrelated temp files are never touched.
- Confirm the sweeper is resilient to per-file OS errors.
- Confirm the sweeper returns the count of removed files.

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

Contracts
---------
Inputs:  tmp_path, monkeypatch pytest fixtures
Outputs: pass/fail assertions

Function Documentation

◆ _make_stale()

None tests_docs.test_doxygen_cleanup._make_stale ( Path path,
float age_seconds )
protected

Definition at line 59 of file test_doxygen_cleanup.py.

Here is the caller graph for this function:

◆ isolated_tmp()

Path tests_docs.test_doxygen_cleanup.isolated_tmp ( Path tmp_path,
monkeypatch )
Redirect ``tempfile.gettempdir()`` to an isolated directory.

Prevents tests from touching (or being polluted by) the real system
temp directory.

Definition at line 46 of file test_doxygen_cleanup.py.

◆ test_sweep_default_constant_is_one_day()

None tests_docs.test_doxygen_cleanup.test_sweep_default_constant_is_one_day ( )
Sanity: the module-level constant matches the documented value.

Definition at line 146 of file test_doxygen_cleanup.py.

◆ test_sweep_handles_unlink_failure_gracefully()

None tests_docs.test_doxygen_cleanup.test_sweep_handles_unlink_failure_gracefully ( Path isolated_tmp,
monkeypatch )
A per-file OSError during unlink must not propagate.

Definition at line 113 of file test_doxygen_cleanup.py.

Here is the call graph for this function:

◆ test_sweep_ignores_unrelated_temp_files()

None tests_docs.test_doxygen_cleanup.test_sweep_ignores_unrelated_temp_files ( Path isolated_tmp)
Files without the oct-doxyfile- prefix are never touched.

Definition at line 87 of file test_doxygen_cleanup.py.

Here is the call graph for this function:

◆ test_sweep_preserves_recent_doxyfile()

None tests_docs.test_doxygen_cleanup.test_sweep_preserves_recent_doxyfile ( Path isolated_tmp)
A freshly-created oct-doxyfile-*.Doxyfile is preserved.

Definition at line 76 of file test_doxygen_cleanup.py.

◆ test_sweep_removes_old_stale_doxyfile()

None tests_docs.test_doxygen_cleanup.test_sweep_removes_old_stale_doxyfile ( Path isolated_tmp)
A 48h-old oct-doxyfile-*.Doxyfile is removed.

Definition at line 65 of file test_doxygen_cleanup.py.

Here is the call graph for this function:

◆ test_sweep_respects_custom_max_age()

None tests_docs.test_doxygen_cleanup.test_sweep_respects_custom_max_age ( Path isolated_tmp)
An explicit max_age_seconds overrides the 24h default.

Definition at line 134 of file test_doxygen_cleanup.py.

Here is the call graph for this function:

◆ test_sweep_returns_count()

None tests_docs.test_doxygen_cleanup.test_sweep_returns_count ( Path isolated_tmp)
The return value equals the number of files actually removed.

Definition at line 98 of file test_doxygen_cleanup.py.

Here is the call graph for this function:

Variable Documentation

◆ name

str tests_docs.test_doxygen_cleanup.name = "oct-doxyfile-locked.Doxyfile":

Definition at line 123 of file test_doxygen_cleanup.py.