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, 50) assert min_width == 16 assert max_width == 16
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, 100) assert min_width == 20 assert max_width == 20
def test_console_width_expand(): console = Console(file=io.StringIO(), width=50) panel = Panel("Hello, World") min_width, max_width = panel.__rich_measure__(console, 50) assert min_width == 50 assert max_width == 50