mirror of https://github.com/Textualize/rich.git
test
This commit is contained in:
parent
966bfb7fc9
commit
5126088a49
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue