test(tslpatcher): strengthen merge artifact and INI section coverage - #181
Merged
Conversation
…i sections Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
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.
Description
Adds regression tests for recent diff/TSLPatcher merge and INI serialization behavior: default merge-conflict artifact location, JSON report consistency with on-disk files, unknown merge conflict policy defaulting, and triple duplicate GFF modifier section names in generated INI.
Type of Change
Package(s) Affected
Risky behavior now covered
tslpatchdata/merge_conflicts/when--merge-conflict-outputis omitted; custom path still works.conflicts.jsoncontract: paths in JSON point to real files; resource name, policy, and mod paths are preserved (catches merge/report drift).mod-aso CLI typos do not flip merge behavior silently.section,section_1,section_2with no duplicate[...]headers (TSLPatcher parser compatibility).Test files added/updated
Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.pyWhy these tests materially reduce regression risk
They lock the merge-to-TSLPatcher workflow’s on-disk debugging artifacts and INI shape to behavior mod authors and patch tools depend on. A bad default path or broken JSON would waste user time without catching it in CI; duplicate INI section names can break TSLPatcher/HoloPatcher readers.
Testing
Ran (environment without
uv; same paths as AGENTS.md):PYTHONPATH=Libraries/PyKotor/src:Libraries/Utility/src:Tools/KotorDiff/src python3 -m pytest --import-mode=importlib Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.py::TestTSLPatcherFromDiff::test_merge_tslpatcher_artifact_default_output_under_tslpatchdata Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.py::TestTSLPatcherFromDiff::test_merge_tslpatcher_conflict_artifacts_json_matches_files Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.py::TestTSLPatcherFromDiff::test_normalize_merge_conflict_policy_defaults_unknown_to_mod_a Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.py::TestTSLPatcherFromDiff::test_serializer_uniquifies_triplicate_modifier_section_names -v— all passed.AgentDecompile status: Skipped - tests only; no game-engine or binary behavior change :(