mirror of https://github.com/Textualize/rich.git
add tests (rule.py coverage 100% now)
This commit is contained in:
parent
b698b8d6d2
commit
e0066e34c2
|
@ -27,7 +27,20 @@ def test_rule():
|
|||
|
||||
|
||||
# doesn't work for now
|
||||
def test_rule_cjk():
|
||||
# def test_rule_cjk():
|
||||
# console = Console(
|
||||
# width=16,
|
||||
# file=io.StringIO(),
|
||||
# force_terminal=True,
|
||||
# color_system=None,
|
||||
# legacy_windows=False,
|
||||
# )
|
||||
# console.rule("欢迎!")
|
||||
# expected = "──── 欢迎! ────\n"
|
||||
# assert console.file.getvalue() == expected
|
||||
|
||||
|
||||
def test_characters():
|
||||
console = Console(
|
||||
width=16,
|
||||
file=io.StringIO(),
|
||||
|
@ -35,8 +48,10 @@ def test_rule_cjk():
|
|||
color_system=None,
|
||||
legacy_windows=False,
|
||||
)
|
||||
console.rule("欢迎!")
|
||||
expected = "──── 欢迎! ────\n"
|
||||
console.rule(characters="+*")
|
||||
console.rule("foo", characters="+*")
|
||||
expected = "+*+*+*+*+*+*+*+*\n"
|
||||
expected += "+*+*+ foo +*+*++\n"
|
||||
assert console.file.getvalue() == expected
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue