Files
WoW-Hybrid-gateway/tests/octo_trade_link_test.py

21 lines
990 B
Python

#!/usr/bin/env python3
"""One focused target: actual gateway relay fixture plus two isolated Lua clients."""
from pathlib import Path
import shutil
import subprocess
import sys
root = Path(__file__).resolve().parents[1]
subprocess.run([sys.argv[1]], check=True)
lua = shutil.which('lua5.1')
if not lua:
raise SystemExit('lua5.1 is required for the client addon fixture')
subprocess.run([lua, str(root/'tests/octo_trade_link_test.lua'),
str(root/'client_addons/OctoTradeLink/OctoTradeLink.lua')], check=True)
# Targeted self-addon services retain their authentication/world boundary.
source = (root/'native/session.cpp').read_text()
start = source.index('if(opcode==0x2d002b){')
end = source.index('auto message=gateway::forever_self_addon_request', start)
assert '!gw_native_transport_authenticated(t)' in source[start:end]
assert '!t->world->self_created' in source[start:end]
print('PASS shared-channel tradeskill transport; targeted self-service admission retained')