MCPcopy
hub / github.com/Textualize/rich / test_console_options_update

Function test_console_options_update

tests/test_console.py:82–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81
82def test_console_options_update() -> None:
83 options = ConsoleOptions(
84 ConsoleDimensions(80, 25),
85 max_height=25,
86 legacy_windows=False,
87 min_width=10,
88 max_width=20,
89 is_terminal=False,
90 encoding="utf-8",
91 )
92 options1 = options.update(width=15)
93 assert options1.min_width == 15 and options1.max_width == 15
94
95 options2 = options.update(min_width=5, max_width=15, justify="right")
96 assert (
97 options2.min_width == 5
98 and options2.max_width == 15
99 and options2.justify == "right"
100 )
101
102 options_copy = options.update()
103 assert options_copy == options and options_copy is not options
104
105
106def test_console_options_update_height() -> None:

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
ConsoleOptionsClass · 0.90
ConsoleDimensionsClass · 0.90

Tested by

no test coverage detected