mirror of
https://github.com/Textualize/rich.git
synced 2025-08-31 15:37:24 +00:00
tests
This commit is contained in:
parent
a590002dc3
commit
c9d148410e
4 changed files with 72 additions and 63 deletions
17
tests/test_padding.py
Normal file
17
tests/test_padding.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import pytest
|
||||
|
||||
from rich.padding import Padding
|
||||
|
||||
|
||||
def test_repr():
|
||||
padding = Padding("foo", (1, 2))
|
||||
assert isinstance(repr(padding), str)
|
||||
|
||||
|
||||
def test_unpack():
|
||||
assert Padding.unpack(3) == (3, 3, 3, 3)
|
||||
assert Padding.unpack((3,)) == (3, 3, 3, 3)
|
||||
assert Padding.unpack((3, 4)) == (3, 4, 3, 4)
|
||||
assert Padding.unpack((3, 4, 5, 6)) == (3, 4, 5, 6)
|
||||
with pytest.raises(ValueError):
|
||||
Padding.unpack((1, 2, 3))
|
Loading…
Add table
Add a link
Reference in a new issue