Fixing test module on non-Windows platforms

This commit is contained in:
Darren Burns 2022-03-01 16:19:18 +00:00
parent 501dcbdfe8
commit 97d05f592a
1 changed files with 8 additions and 8 deletions

View File

@ -11,6 +11,14 @@ from rich.style import Style
try:
from rich._win32_console import COORD, LegacyWindowsTerm, WindowsCoordinates
CURSOR_X = 1
CURSOR_Y = 2
CURSOR_POSITION = WindowsCoordinates(row=CURSOR_Y, col=CURSOR_X)
SCREEN_WIDTH = 20
SCREEN_HEIGHT = 30
DEFAULT_STYLE_ATTRIBUTE = 16
except ImportError:
pass
@ -23,14 +31,6 @@ def test_windows_coordinates_to_ctype():
assert coord.Y == 1
CURSOR_X = 1
CURSOR_Y = 2
CURSOR_POSITION = WindowsCoordinates(row=CURSOR_Y, col=CURSOR_X)
SCREEN_WIDTH = 20
SCREEN_HEIGHT = 30
DEFAULT_STYLE_ATTRIBUTE = 16
@dataclasses.dataclass
class StubScreenBufferInfo:
dwCursorPosition: COORD = COORD(CURSOR_X, CURSOR_Y)