mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
30 lines
792 B
Python
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()
|