Skip to content

test(cli): cover diff cli_utils path normalization and install detection - #333

Closed
cursor[bot] wants to merge 1 commit into
masterfrom
impl/missing-test-coverage-51cd
Closed

cursor[bot] wants to merge 1 commit into
masterfrom
impl/missing-test-coverage-51cd

Conversation

@cursor

@cursor cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds regression tests for pykotor.diff_tool.cli_utils, which was updated in the case-aware path work (#151) but had no direct test coverage.

Risky behavior now covered

  • normalize_path_arg: PowerShell quoting edge cases (mangled " concatenation, embedded quotes, trailing backslashes) that break diff/patch CLI path inputs on Windows.
  • is_kotor_install_dir: Case-aware install detection via chitin.key lookup — used by diff, patching, and TSLPatcher diff engine to route installation-vs-file comparisons.

Test files added/updated

  • Libraries/PyKotor/tests/cli/test_diff_cli_utils.py (new, 15 tests)

Why these tests materially reduce regression risk

  • All three is_kotor_install_dir implementations (cli_utils, patching, tslpatcher.diff.engine) are asserted in parallel so a future refactor cannot silently diverge.
  • Case-mismatched install directory detection is covered on POSIX (skipped on Windows where semantics differ).
  • normalize_path_arg parametrized cases lock in the quoting fixes that prevent CLI failures when users pass paths with spaces from PowerShell.

Validation

pytest Libraries/PyKotor/tests/cli/test_diff_cli_utils.py -v
# 15 passed
Open in Web View Automation 

…n tests

Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
@github-actions github-actions Bot added python Pull requests that update python code libraries labels Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Message that will be displayed on users' first pull request

@github-actions github-actions Bot added the size/S Small PR (30-100 lines) label Jun 10, 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.

@ProjectSynchro
ProjectSynchro deleted the impl/missing-test-coverage-51cd branch October 28, 2026 20:25
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/S Small PR (30-100 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants