Skip to content

test(cli): indoor kit migrate v1-to-v2 regression coverage#222

Open
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/regression-test-coverage-d7c7
Open

test(cli): indoor kit migrate v1-to-v2 regression coverage#222
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/regression-test-coverage-d7c7

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 4, 2026

Description

Adds regression tests for the indoor-kit-migrate-v1-to-v2 CLI command (cmd_indoor_kit_migrate_v1_to_v2): successful v1→v2 write, missing input, migrator rejection of already-v2 JSON, and malformed JSON handling.

Type of Change

  • ✅ Test addition or update

Package(s) Affected

  • PyKotor (core library)

Risky behavior now covered

  • Kit migration pipeline: end-to-end read v1 JSON from disk, invoke migrate_kit_json_v1_to_v2, write v2 JSON with format_version 2 and expected template structure (exercises the same path as the real subcommand, not only the library helper in isolation).
  • I/O and exit codes: missing input file (exit 1, no output), v2 input rejected by migrator (exit 1, no output), invalid JSON (exit 1) — reduces risk of silent success or partial writes on bad input.

Test files added/updated

  • Libraries/PyKotor/tests/cli/test_indoor_kit_migrate_cli.py (new)

Why this reduces regression risk

Indoor tilekit v2 and migrate_kit_json_v1_to_v2 are already tested in test_tilekit_v2.py, but the CLI layer (path handling, mkdir parents, JSON IO, and which exception messages reach the user) had no direct tests. Failures there break mod author workflows without touching core migrate logic. These tests are filesystem-local and deterministic (temp dirs only).

Testing

cd Libraries/PyKotor && uv sync --extra dev && uv pip install pytest-timeout -q
QT_QPA_PLATFORM=offscreen uv run pytest --import-mode=importlib -m "not gui and not slow" --timeout=120 tests/cli/test_indoor_kit_migrate_cli.py -q
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (target file above)

Related Issues

Related to indoor tilekit / kit migration CLI work on recent master merges.

Open in Web View Automation 

Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
@github-actions github-actions Bot added python Pull requests that update python code libraries size/S Small PR (30-100 lines) labels May 4, 2026
@th3w1zard1 th3w1zard1 marked this pull request as ready for review May 9, 2026 03:37
@th3w1zard1 th3w1zard1 self-requested a review as a code owner May 9, 2026 03:37
@th3w1zard1
Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

Co-authored-by: th3w1zard1 <2219836+th3w1zard1@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 1b89b3e. The only conflict was in test_indoor_kit_migrate_cli.py — both this branch and master (PR #234) added that file with different implementations. Merged origin/master and kept master's version (which tests via cli_main dispatch for fuller end-to-end coverage). All 5 tests pass.

@github-actions github-actions Bot added the package: pykotor Related to PyKotor core label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries package: pykotor Related to PyKotor core 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.

3 participants