Skip to content

Fix Windows system-path detection and make CLI help assertions robust#7

Merged
AperturePlus merged 1 commit intodevelopfrom
codex/fix-assertion-errors-in-windows-path-tests-y8hcnh
Feb 21, 2026
Merged

Fix Windows system-path detection and make CLI help assertions robust#7
AperturePlus merged 1 commit intodevelopfrom
codex/fix-assertion-errors-in-windows-path-tests-y8hcnh

Conversation

@AperturePlus
Copy link
Owner

Motivation

  • Prevent false negatives when detecting Windows system directories on non-Windows hosts by handling drive/root prefixes consistently for paths like C:\Program Files (x86).
  • Make CLI help tests resilient to Rich/Typer output differences (ANSI sequences and layout) to avoid brittle assertions in CI.

Description

  • Adjust _is_windows_system_directory in src/aci/core/path_utils.py to normalize the first Windows path part using rstrip("\\/") before matching drive letters so drive roots are stripped reliably.
  • Harden tests/unit/test_cli.py by removing ANSI escape sequences from command output and asserting on stable tokens (workers, limit, filter, -w) instead of exact long-option rendering.

Testing

  • Ran a quick reproduction invoking _is_windows_system_directory with Path(r"C:\\Program Files (x86)") which returned True as expected.
  • Executed pytest tests/unit/test_cli.py::TestCLIHelp::test_index_help tests/unit/test_cli.py::TestCLIHelp::test_search_help -q and both tests passed.
  • Attempted to run the property tests that originally failed but collection failed in this environment due to missing hypothesis (error: ModuleNotFoundError: No module named 'hypothesis'), so full property-suite verification could not be completed here.

Codex Task

@AperturePlus AperturePlus merged commit 38d12e8 into develop Feb 21, 2026
2 checks passed
@AperturePlus AperturePlus deleted the codex/fix-assertion-errors-in-windows-path-tests-y8hcnh branch February 22, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant