test: add case-aware path and CLI regression coverage (5096)#329
Draft
cursor[bot] wants to merge 7 commits into
Draft
test: add case-aware path and CLI regression coverage (5096)#329cursor[bot] wants to merge 7 commits into
cursor[bot] wants to merge 7 commits into
Conversation
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Contributor
|
Message that will be displayed on users' first pull request |
|
|
||
| class TestChooseCaseMatch(unittest.TestCase): | ||
| def test_prefers_exact_case_when_ambiguous(self) -> None: | ||
| chosen = _choose_case_match("File", ["file", "File"], "/tmp") |
| self.assertEqual(chosen, "File") | ||
|
|
||
| def test_picks_best_character_overlap_when_no_exact(self) -> None: | ||
| chosen = _choose_case_match("teSt", ["TEST", "tEst", "teSt"], "/tmp") |
| self.assertEqual(chosen, "teSt") | ||
|
|
||
| def test_single_match_returns_only_candidate(self) -> None: | ||
| chosen = _choose_case_match("only", ["only"], "/tmp") |
Contributor
🔨 Build Validation Summary✅ Version Check: Passed Tool Builds
🎉 All builds validated successfully! This PR is ready for merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds targeted regression tests for recently merged case-aware path handling (PR #151) and related CLI/export fixes where production code changed without adequate test coverage.
Risky behavior now covered
normalize_path_argmangled-path recovery, quote stripping, and trailing-slash cleanup (diff/merge CLI entry points).is_kotor_install_diracrosscli_utils,patching, andtslpatcher.diff.enginewith case-mismatchedchitin.keyand install root paths._choose_case_matchambiguity resolution,clear_cache, directory-segment case correction, and cache reuse.load_kits_unifiedwith case-mismatched kits directory names._supports_live_progressdisabled underCI/GITHUB_ACTIONSso automation logs remain visible.create_installationpreserves canonicalModulesdirectory casing.ConfigReader.from_filepathresolves case-mismatched mod directory and ini filenames.Test files added/updated
Libraries/PyKotor/tests/diff_tool/test_cli_utils.pyLibraries/PyKotor/tests/common/test_is_kotor_install_dir.pyLibraries/PyKotor/tests/common/test_case_aware_path_cache.pyLibraries/PyKotor/tests/test_indoorkit_case_path.pyLibraries/PyKotor/tests/cli/test_json_commands.pyLibraries/PyKotor/tests/extract/test_installation.pyLibraries/PyKotor/tests/tslpatcher/test_reader.pyWhy these tests materially reduce regression risk
Case-aware path resolution is now used across extract, diff, tslpatcher, and indoor-builder flows. A regression would surface as silent file-not-found failures on Linux/macOS when users or scripts pass paths with different casing than on-disk names. These tests lock in the behavior at the utility, CLI, and consumer layers.
The CI progress guard prevents JSON export from switching to TTY-only
\rupdates in GitHub Actions, which would hide percentage milestones from log aggregators and caplog-based tests.Validation
Case-mismatch tests are skipped on Windows where filesystem semantics differ.