mirror of
https://github.com/rr-/pq-cli.git
synced 2026-11-12 22:40:36 -07:00
tests/pty_app.py starts pqcli with pty.fork at a fixed size, with XDG_CONFIG_HOME in a temporary directory, and feeds its output to a pyte screen. Tests send keys and poll the screen until it matches, counting a match once the output pauses or the match has held for a moment, so they never read a half-drawn frame and need no fixed sleeps. The tests cover the roster menu, creating a character (names, races, classes, rolling and unrolling stats, and every way back), the game view's panes, focus moves and page scrolling, deleting, importing and exporting .pqw files, resizing the terminal, the cheat keys, Ctrl+C and --load-save. They are skipped on Windows. pyte does not draw the DEC line drawing characters, so the app runs with NCURSES_NO_UTF8_ACS=1 to draw its boxes with Unicode lines.