tower-learns-you / tests /test_tasks.py
vknt's picture
Deploy The Tower Learns You (custom gr.Server frontend, hf_inference + mock fallback)
22a027e verified
Raw
History Blame Contribute Delete
556 Bytes
from tower_game.tasks import GameTaskCoordinator, TaskIdentity
def test_task_coordinator_returns_identity_and_typed_result():
coordinator = GameTaskCoordinator(model_workers=1, cpu_workers=1)
identity = TaskIdentity("run-1", 2, "turn-3", "boss_turn_decision")
job = coordinator.submit_model(identity, lambda: ({"move_index": 1}, {"mode": "ready"}))
result = coordinator.wait(job, timeout=2)
assert result.identity == identity
assert result.value == {"move_index": 1}
assert result.agent_status == {"mode": "ready"}