mirror of
https://github.com/Textualize/rich.git
synced 2025-08-03 17:48:25 +00:00
changed test to use builtin str
This commit is contained in:
parent
af5b5e1088
commit
b37b6937e2
1 changed files with 10 additions and 18 deletions
|
@ -68,27 +68,19 @@ def test_render():
|
|||
|
||||
|
||||
def test_inspect_text():
|
||||
from rich.text import Text
|
||||
|
||||
t = Text("Hello, World")
|
||||
|
||||
expected = (
|
||||
"╭─ <class 'rich.text.Text'> ─╮\n"
|
||||
"│ Text with color / style. │\n"
|
||||
"│ │\n"
|
||||
"│ cell_len = 12 │\n"
|
||||
"│ end = '\\n' │\n"
|
||||
"│ justify = None │\n"
|
||||
"│ no_wrap = None │\n"
|
||||
"│ overflow = None │\n"
|
||||
"│ plain = 'Hello, World' │\n"
|
||||
"│ spans = [] │\n"
|
||||
"│ style = '' │\n"
|
||||
"│ tab_size = 8 │\n"
|
||||
"╰────────────────────────────╯\n"
|
||||
"╭──────────────── <class 'str'> ─────────────────╮\n"
|
||||
"│ str(object='') -> str │\n"
|
||||
"│ str(bytes_or_buffer[, encoding[, errors]]) -> │\n"
|
||||
"│ str │\n"
|
||||
"│ │\n"
|
||||
"│ 33 attribute(s) not shown. Use │\n"
|
||||
"│ inspect(<OBJECT>, all=True) to see all │\n"
|
||||
"│ attributes. │\n"
|
||||
"╰────────────────────────────────────────────────╯\n"
|
||||
)
|
||||
|
||||
assert expected == render(t)
|
||||
assert expected == render("Hello")
|
||||
|
||||
|
||||
@skip_py36
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue