Skip to content

Add test suite (45 tests) + GitHub Actions CI - #14

Merged
ltsuemitsu merged 1 commit into
mainfrom
feature/tests-ci
Jul 18, 2026
Merged

Add test suite (45 tests) + GitHub Actions CI#14
ltsuemitsu merged 1 commit into
mainfrom
feature/tests-ci

Conversation

@ltsuemitsu

Copy link
Copy Markdown
Owner

Phase 3 foundation: tests + CI

The project had zero tests — every change (like the 4 PRs we just merged) was verified by hand. This adds the safety net.

Test suite — 45 tests, stdlib unittest only (no pytest needed)

File Tests Covers
tests/test_tradutor.py 24 TagProtector protect/restore round-trip (game markup {g|…}, <color>, <sprite>, <link>), SmartGlossary preserve logic (flags, categories, complete vs preserve mode, exact/contains matching), split_batch token cap, blacklist loading, atomic_save
tests/test_diff_tool.py 7 detect_update patch deltas, audit_translation untranslated detection, smart_diff
tests/test_merge.py 4 merge + backup, validator guard, dry-run
tests/test_glossary_wiki.py 10 GlossaryEntry round-trip, load/save, wiki dataset integrity (16 categories / 2,694 terms)
  • Runs with python -m unittest discover -s tests -vcurrently 45/45 green
  • Zero network, zero API keys; fixtures are tiny synthetic Owlcat JSONs in temp dirs

CI — .github/workflows/tests.yml

README

CI badge + Development section with test instructions.

Notes

  • Tests documented three real engine behaviors worth knowing (not bugs): contains-match only runs for texts >15 chars; hyphen↔space variant is one-directional; merge's validator guard refuses only when all items are untranslated.
  • GUI (tradutor_desktop.py) intentionally not in CI scope (PySide6 excluded); core engine is fully covered.

After merge, every future PR gets an automatic green/red check.

- tests/test_tradutor.py: TagProtector round-trip, SmartGlossary preserve
  logic (flags, categories, modes, exact/contains matching), split_batch,
  blacklist loading, atomic_save
- tests/test_diff_tool.py: detect_update, audit_translation, smart_diff
- tests/test_merge.py: merge+backup, validator guard, dry-run
- tests/test_glossary_wiki.py: GlossaryEntry round-trip, load/save,
  wiki dataset integrity (16 categories / 2,694 terms)
- CI: ubuntu+windows x Python 3.10/3.12, compileall syntax gate +
  unittest; stdlib-only test deps (openai+tqdm for imports)
- README: CI badge + Development section
@ltsuemitsu
ltsuemitsu merged commit 15aa63d into main Jul 18, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant