dcs_liberation/tests/ato/flightstate/test_actionstate.py
2023-08-29 21:57:17 -07:00

30 lines
792 B
Python

from collections.abc import Iterator
from datetime import timedelta, datetime
from dcs.task import Task
from game.ato.flightstate.actionstate import ActionState
from game.flightplan.waypointactions.taskcontext import TaskContext
from game.flightplan.waypointactions.waypointaction import WaypointAction
class TestAction(WaypointAction):
def describe(self) -> str:
return ""
def update_state(
self, state: ActionState, time: datetime, duration: timedelta
) -> timedelta:
return timedelta()
def iter_tasks(self, ctx: TaskContext) -> Iterator[Task]:
yield from []
def test_actionstate() -> None:
action = TestAction()
state = ActionState(action)
assert not state.is_finished()
state.finish()
assert state.is_finished()