rich/tests/test_constrain.py

12 lines
319 B
Python
Raw Normal View History

2020-08-25 16:09:56 +00:00
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