Fixing test module on non-Windows platforms

This commit is contained in:
Darren Burns 2022-03-01 16:23:05 +00:00
parent 97d05f592a
commit 7d08e0a7cd
1 changed files with 6 additions and 7 deletions

View File

@ -19,6 +19,12 @@ try:
SCREEN_HEIGHT = 30
DEFAULT_STYLE_ATTRIBUTE = 16
@dataclasses.dataclass
class StubScreenBufferInfo:
dwCursorPosition: COORD = COORD(CURSOR_X, CURSOR_Y)
dwSize: COORD = COORD(SCREEN_WIDTH, SCREEN_HEIGHT)
wAttributes: int = DEFAULT_STYLE_ATTRIBUTE
except ImportError:
pass
@ -31,13 +37,6 @@ def test_windows_coordinates_to_ctype():
assert coord.Y == 1
@dataclasses.dataclass
class StubScreenBufferInfo:
dwCursorPosition: COORD = COORD(CURSOR_X, CURSOR_Y)
dwSize: COORD = COORD(SCREEN_WIDTH, SCREEN_HEIGHT)
wAttributes: int = DEFAULT_STYLE_ATTRIBUTE
@pytest.fixture
def win32_handle():
handle = mock.sentinel