From 5126088a49753f937e4b8a1d8a37ce23c588b538 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 25 Nov 2020 17:54:16 +0000 Subject: [PATCH] test --- tests/test_panel.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_panel.py b/tests/test_panel.py index c2c6e3b2..da6ad785 100644 --- a/tests/test_panel.py +++ b/tests/test_panel.py @@ -1,5 +1,6 @@ import io from rich.console import Console +from rich.measure import Measurement from rich.panel import Panel import pytest @@ -42,6 +43,14 @@ def test_console_width(): 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 + + if __name__ == "__main__": expected = [] for panel in tests: