11# SPDX-License-Identifier: GPL-3.0-or-later
22# SPDX-FileCopyrightText: 2026 sp00ktober
33import random
4- import shutil
54from collections .abc import Iterator
65from pathlib import Path
76
@@ -24,11 +23,9 @@ def open_port(games: Data, path: Path) -> MonsterWorkspace:
2423
2524
2625@pytest .fixture
27- def zinogre (games : Data , ports : Path , tmp_path : Path ) -> Iterator [MonsterWorkspace ]:
26+ def zinogre (games : Data , zinogre_toml : Path ) -> Iterator [MonsterWorkspace ]:
2827 """The Zinogre opened from a copy of its manifest."""
29- path = tmp_path / "zinogre.toml"
30- shutil .copy (ports / "zinogre.toml" , path )
31- ws = open_port (games , path )
28+ ws = open_port (games , zinogre_toml )
3229 yield ws
3330 ws .close ()
3431
@@ -121,12 +118,11 @@ def test_place_refusals(zinogre):
121118 assert "past the host's 123" in ws .message and entries (ws ) == before
122119
123120
124- def test_unplaced (games , ports , tmp_path , monkeypatch ):
121+ def test_unplaced (games , ports , tmp_path , monkeypatch , zinogre_toml ):
125122 """A host with 100 anims leaves 4 Zinogre clips out: listed, played from a preview, named
126123 without an anim; a placement over a pinned clip has nowhere to send it."""
127124 monkeypatch .setitem (layout .ENTRIES , 75 , 100 )
128- path = tmp_path / "zinogre.toml"
129- shutil .copy (ports / "zinogre.toml" , path )
125+ path = zinogre_toml
130126 ws = open_port (games , path )
131127 out = [r .id for r in ws .source_rows () if r .entry is None ]
132128 assert len (out ) == 4 and len (ws .scene .clips ) == 98
@@ -176,15 +172,14 @@ def _clip(frames: int) -> Clip:
176172 return Clip ([Track ([Channel (0x008 , [Keyframe (0 , 0 ), Keyframe (0 , frames )])])])
177173
178174
179- def test_place_every_clip (games , ports , tmp_path ):
175+ def test_place_every_clip (games , ports , tmp_path , zinogre_toml ):
180176 """All 102 placed into a shuffled layout, one after another: each lands where it was put
181177 and stays, the saved manifest loads on that layout, and the port builds on it."""
182178 from mhfu_port import build , manifest
183179 from mhfu_studio .monster .clips import pac_clip_table
184180 from mhfu_studio .monster .document import PortDocument
185181
186- path = tmp_path / "zinogre.toml"
187- shutil .copy (ports / "zinogre.toml" , path )
182+ path = zinogre_toml
188183 doc = PortDocument .open (path )
189184 d , h = build .donor (doc .manifest , games ), build .host (doc .manifest , games )
190185 br = B .ClipBrowser (doc , d .clips , h .anim )
@@ -203,11 +198,10 @@ def test_place_every_clip(games, ports, tmp_path):
203198 assert all (table [e ] == br .prints [cid ] for cid , e in want .items ())
204199
205200
206- def test_view_follows_a_placement (gl , games , ports , tmp_path ):
201+ def test_view_follows_a_placement (gl , games , ports , tmp_path , zinogre_toml ):
207202 """On a viewport: the placed clip plays on in its new anim, and undo brings the old build
208203 back on screen."""
209- path = tmp_path / "zinogre.toml"
210- shutil .copy (ports / "zinogre.toml" , path )
204+ path = zinogre_toml
211205 ws = MonsterWorkspace (games )
212206 ws .intel_cache [75 ] = None
213207 ws .setup (gl )
0 commit comments