(
SetConsoleTextAttribute, win32_console_getters, win32_handle
)
| 104 | |
| 105 | @patch.object(_win32_console, "SetConsoleTextAttribute") |
| 106 | def test_write_styled_bold( |
| 107 | SetConsoleTextAttribute, win32_console_getters, win32_handle |
| 108 | ): |
| 109 | style = Style.parse("bold black on red") |
| 110 | text = "Hello, world!" |
| 111 | term = LegacyWindowsTerm(sys.stdout) |
| 112 | |
| 113 | term.write_styled(text, style) |
| 114 | |
| 115 | call_args = SetConsoleTextAttribute.call_args_list |
| 116 | first_args, first_kwargs = call_args[0] |
| 117 | |
| 118 | expected_attr = 64 + 8 # 64 for red bg, +8 for bright black |
| 119 | assert first_args == (win32_handle,) |
| 120 | assert first_kwargs["attributes"].value == expected_attr |
| 121 | |
| 122 | @patch.object(_win32_console, "SetConsoleTextAttribute") |
| 123 | def test_write_styled_reverse( |
nothing calls this directly
no test coverage detected