Files
EscapistsReintroduced/tests/test_native_observer_selector.py
T
2026-10-21 15:28:32 +02:00

22 lines
1.4 KiB
Python

"""Wrong camera-fixture selector must fail before profile or engine setup."""
from pathlib import Path
import subprocess,sys,tempfile
ROOT=Path(__file__).resolve().parents[1]
with tempfile.TemporaryDirectory(prefix='erri-observer-selector-') as folder:
root=Path(folder)
result=subprocess.run([sys.executable,'-B',str(ROOT/'tools/headless_workbench.py'),
'--steam',str(root/'missing-steam'),'--compat',str(root/'missing-prefix'),
'--profile',str(root/'unused-profile'),'--smoke','unconscious-camera',
'--project','chat','--rounds','1'],capture_output=True,text=True)
assert result.returncode==2,(result.returncode,result.stdout,result.stderr)
assert 'unconscious-camera requires --project core' in result.stderr,result.stderr
assert not list(root.iterdir()),'Invalid selection must not create native runtime/profile files'
print('PASS: wrong observer fixture selector rejected before runtime/profile setup; no engine launched')
# This camera fixture requires no historical site coordinates. Use the current
# generated scenario so the two-aircraft landing survey can find enough space.
scenario=(ROOT/'addons/core/Scripts/Game/ERR/00_Core/ERR_ScenarioComponent.c').read_text()
for variable in ('historicalFixture','fixture'):
assert variable+' != "unconscious-camera"' in scenario
print('PASS: native camera fixture uses current generated sites instead of the obsolete fixed extraction pickup')