mirror of https://github.com/Textualize/rich.git
Fixing test module on non-Windows platforms
This commit is contained in:
parent
501dcbdfe8
commit
97d05f592a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue