Files
Triforce-Source/tests/test_chunks_save_folder.py
ruckus7382sfgsgdf 4fa4f9188b Triforce v0.8.0
Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
2026-11-25 10:21:32 -06:00

38 lines
1.6 KiB
Python

"""chunks.save makes the folder it records the boundaries in (nx2/chunks.py).
`python -I nx2/lift.py --standalone --write` writes the boundaries to <work>/image/chunks.txt, while the image goes
to <work>/sa/image; on a fresh work folder nothing had made <work>/image, and the lift stopped after its translation
with FileNotFoundError, at the last step (make_game.py prepares the folder, the documented command did not).
python -I -B tests/test_chunks_save_folder.py
"""
import sys
import tempfile
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "nx2"))
import kit # noqa: E402,F401 (a64-kit on the path)
import chunks # noqa: E402
def main():
with tempfile.TemporaryDirectory(prefix="triforce-chunks-save-") as temp:
# (a standalone lift's folder: <work>/image, with <work> existing and image/ not)
work = Path(temp) / "work"
work.mkdir()
image = work / "image"
assert not image.exists(), "the fixture must start without the folder"
chunks.save(str(image), [0x80002000, 0x80001000])
path = image / chunks.FILE
assert path.is_file(), "chunks.save did not make its folder: %s" % path
assert chunks.load(str(image)) == [0x80001000, 0x80002000], chunks.load(str(image))
# (as lift.py does on a later lift: the folder is there and the file is replaced, not appended)
chunks.save(str(image), [0x80003000])
assert chunks.load(str(image)) == [0x80003000], chunks.load(str(image))
print("chunks.save makes <work>/image and writes the boundaries: ok")
if __name__ == "__main__":
main()