Skip to content

test: add case-aware path and diff CLI regression coverage#336

Draft
cursor[bot] wants to merge 2 commits into
masterfrom
impl/missing-test-coverage-f154
Draft

test: add case-aware path and diff CLI regression coverage#336
cursor[bot] wants to merge 2 commits into
masterfrom
impl/missing-test-coverage-f154

Conversation

@cursor

@cursor cursor Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • is_kotor_install_dir (diff CLI + TSLPatcher diff engine): installation detection with case-mismatched directory paths on POSIX (regression guard for case-aware application Case-aware application #151)
  • ConfigReader.from_filepath: loading changes.ini when the on-disk filename casing differs from the requested path
  • load_kits_unified: discovering kit JSON files when the kits root directory casing differs
  • CaseAwarePath directory cache: clear_cache() allows resolution to track renamed directories after cache invalidation
  • normalize_path_arg: PowerShell/Windows quote-mangling edge cases that previously had no direct tests

Test files added/updated

  • Libraries/PyKotor/tests/common/test_case_aware_consumers.py (new)
  • Libraries/PyKotor/tests/cli/test_diff_cli_utils.py (new)

Why these tests materially reduce regression risk

Case-aware path resolution was rolled out across core extract, diff, and patcher entry points. Without targeted tests, a future refactor to plain pathlib.Path could silently break Linux/macOS installs where users or tooling pass lower-case paths to mixed-case game directories. The normalize_path_arg tests protect diff CLI path parsing that handles real-world PowerShell quoting bugs.

Validation

cd Libraries/PyKotor
uv pip install pytest pytest-timeout loggerplus
PYTHONPATH="src:../Utility/src" uv run python -m pytest --import-mode=importlib --timeout=120 --noconftest \
  tests/common/test_case_aware_consumers.py tests/cli/test_diff_cli_utils.py -v

All 11 tests passed on Linux (POSIX case-resolution tests skip on Windows by design).

Open in Web View Automation 

cursoragent and others added 2 commits June 18, 2026 10:08
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Message that will be displayed on users' first pull request

@github-actions github-actions Bot added python Pull requests that update python code libraries size/M Medium PR (100-300 lines) labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔨 Build Validation Summary

Version Check: Passed

Tool Builds

⚠️ HoloPatcher: cancelled
⚠️ HoloPazaak: cancelled
⚠️ HolocronToolset: cancelled
⚠️ KotorDiff: cancelled
⚠️ KotorMCP: cancelled


🎉 All builds validated successfully! This PR is ready for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries python Pull requests that update python code size/M Medium PR (100-300 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant