summaryrefslogtreecommitdiffstats
path: root/tests/test_constrain.py
blob: 6fc96363a1fd6216aa261ad0f3b05c5ef847e664 (plain)
1
2
3
4
5
6
7
8
9
10
11
from rich.console import Console
from rich.constrain import Constrain
from rich.text import Text


def test_width_of_none():
    console = Console()
    constrain = Constrain(Text("foo"), width=None)
    min_width, max_width = constrain.__rich_measure__(console, 80)
    assert min_width == 3
    assert max_width == 3