Update tests
All checks were successful
CI / test (push) Successful in 51s
CI / test (almalinux, docker.io/library/almalinux:9, python3.11) (push) Successful in 11m30s
CI / test (debian, docker.io/library/debian:13, python3) (push) Successful in 19m55s
Lint / test (push) Successful in 44s

This commit is contained in:
Miguel Jacq 2026-06-22 11:06:24 +10:00
parent a0914e1369
commit c7a6bfe979
Signed by: mig5
GPG key ID: 03906B4110AAD3B8
5 changed files with 212 additions and 0 deletions

View file

@ -1,7 +1,21 @@
import sys
from pathlib import Path
import pytest
# Ensure repository root is on sys.path so `import enroll` resolves to the local package.
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
@pytest.fixture(autouse=True)
def _disable_cli_root_path_prompt_by_default(monkeypatch):
"""Keep CLI tests deterministic when the test runner itself runs as root.
Individual tests that cover the root PATH guard can override this monkeypatch.
"""
import enroll.cli as cli
monkeypatch.setattr(cli, "_is_effective_root", lambda: False)