mirror of
https://github.com/rr-/pq-cli.git
synced 2026-11-12 22:40:36 -07:00
tests: type queued tasks in the upstream bridge
Player.queue holds BaseTask instances, so the bridge's queue encoder takes BaseTask too. ty flagged this once it covered the tests.
This commit is contained in:
1 file changed
+2
-2
@@ -11,9 +11,9 @@ from pqcli.config import EquipmentType, Monster, StatType
|
|||||||
from pqcli.game_data import GameData
|
from pqcli.game_data import GameData
|
||||||
from pqcli.lingo import to_roman
|
from pqcli.lingo import to_roman
|
||||||
from pqcli.mechanic import (
|
from pqcli.mechanic import (
|
||||||
|
BaseTask,
|
||||||
Player,
|
Player,
|
||||||
PlotTask,
|
PlotTask,
|
||||||
RegularTask,
|
|
||||||
Simulation,
|
Simulation,
|
||||||
Stats,
|
Stats,
|
||||||
)
|
)
|
||||||
@@ -106,7 +106,7 @@ def make_spec(seed: str, race: str, class_: str) -> dict[str, Any]:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _queue_entry(task: RegularTask) -> str:
|
def _queue_entry(task: BaseTask) -> str:
|
||||||
kind = "plot" if isinstance(task, PlotTask) else "task"
|
kind = "plot" if isinstance(task, PlotTask) else "task"
|
||||||
text = "Loading" if isinstance(task, PlotTask) else task.description
|
text = "Loading" if isinstance(task, PlotTask) else task.description
|
||||||
return f"{kind}|{task.duration // 1000}|{text}"
|
return f"{kind}|{task.duration // 1000}|{text}"
|
||||||
|
|||||||
Reference in new issue
Block a user