Files
gig-line/Tools/tests
zwitschi 1b722048ce fix(tools): importers clear the read-only LFS bit before saving; docs refresh
0.1.3 packaging and setup fixes from what 0.1.x actually exposed.

- New Tools/ue_common.py: make_writable() clears the read-only bit an LFS .umap
  checks out with (save_map() otherwise returns False silently and the staged actor
  is lost) and require_saved() makes that failure visible. ue_hero_facade_import and
  ue_import_north_buildings now call it; the map builders already did. Verified from
  a forced 0o444 map: chmod logged, save_map True, exit 0.
- Docs/build.md: pipeline table now lists the seven site FBXs plus frontage, north,
  hero and map steps and the shared FBX preset; packaging archive corrected to
  Builds/GigLineQA; packaged-log location and -qaselftest usage documented; new
  'Traps that cost real time in 0.1.x' table (read-only save, hero --out is the FBX,
  MPFB add-on path, shot actor quitting under QA, null-RHI trace trap).
- Docs/setup.md: fresh-checkout build marked verified 2026-11-08 and the blocker
  closed; new optional-keys section for OPENROUTER_API_KEY and MAPBOX_ACCESS_TOKEN
  (gitignored .env, not needed by build/tests/release).
- Docs/Architecture 07 + architecture.md: build-output path corrected, marked
  outside the repository.
- 5 new tests for ue_common (54 total).
2026-11-08 18:50:37 +01:00
..

Tooling tests

Standard-library unittest tests for the host-side tools in Tools/. They never start Blender, Unreal, or the game; anything that needs those processes is verified by the tool itself and recorded in Docs/release-checks.md instead.

Run from the repository root:

python3 -m pip install -r requirements-tools.txt
python3 -m unittest discover -s Tools/tests -t Tools -p 'test_*.py'

The -t Tools top-level directory is required: the tests import the tool modules by their plain names (import input_emulation), which is why Tools/tests/ carries an __init__.py.

Individual test:

python3 -m unittest Tools.tests.test_input_emulation -v

What belongs here

Test the pure parts — argument parsing, key/coordinate encoding, geometry maths, licence gating, report formatting, decision classification. Network, Blender and Unreal calls stay out: a test that needs a paid API, a display, or an engine process is a manual check, not a unit test.

When a tool's logic is buried in main(), extract it into a function so it can be tested directly. That is a tooling improvement, not test scaffolding.

Geo (Geo/tools/) and Blender (Art/blender/*/) builders are tested the same way once their pure parts are extracted; note the module path in the test.