tests: cover the basic UI

Drive the line-based UI in-process: input() answers come from a list
and the output is captured. The tests walk the main menu through
creating, playing, querying, deleting, importing and exporting
characters, plus bad menu input and the Ctrl+C handler.

The play loop runs on a fake clock that advances a minute per call and
stops when time.sleep has been called a set number of times, so it
levels up and saves on schedule without waiting.

The test helpers move to tests/helpers.py, which now also holds the
input() feeder.
This commit is contained in:
Dash committed 2026-10-17 19:46:05 +02:00
1 parent 083dbe01c2
commit f8c370cc2e
4 files changed
+501 -18

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ from datetime import datetime, timedelta
from pathlib import Path
import pytest
from saves import hero
from helpers import hero
from pqcli import roster as roster_module
from pqcli.roster import Roster