rich/tests/test_constrain.py

14 lines
363 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)
2021-03-25 21:08:36 +00:00
min_width, max_width = constrain.__rich_measure__(
console, console.options.update_width(80)
)
2020-08-25 16:09:56 +00:00
assert min_width == 3
assert max_width == 3