def test_fixed_width(): console = Console(file=io.StringIO(), width=50, legacy_windows=False) panel = Panel("Hello World", width=20) min_width, max_width = panel.__rich_measure__(console, console.options) assert min_width == 20 assert max_width == 20
def test_console_width(): console = Console(file=io.StringIO(), width=50, legacy_windows=False) panel = Panel("Hello, World", expand=False) min_width, max_width = panel.__rich_measure__(console, console.options) assert min_width == 16 assert max_width == 16