File size: 556 Bytes
22a027e
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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"}