test: add tests for Application class

Need more attention here. Very difficult to test the keyboard interaction with questionary. Going to try using pexpect soon to hopefully add better coverage.
This commit is contained in:
Nathaniel Landau
2023-01-23 00:31:08 +00:00
parent 3fd6866760
commit b7735760e9
6 changed files with 67 additions and 5 deletions

View File

@@ -4,6 +4,24 @@
import re
class KeyInputs:
"""Key inputs for testing."""
DOWN = "\x1b[B"
UP = "\x1b[A"
LEFT = "\x1b[D"
RIGHT = "\x1b[C"
ENTER = "\r"
ESCAPE = "\x1b"
CONTROLC = "\x03"
BACK = "\x7f"
SPACE = " "
TAB = "\x09"
ONE = "1"
TWO = "2"
THREE = "3"
class Regex:
"""Assert that a given string meets some expectations.