From e0066e34c2e68ee6503152ab28edfc194bf4cff6 Mon Sep 17 00:00:00 2001 From: Hedy Li Date: Wed, 5 Aug 2020 09:38:02 +0000 Subject: [PATCH] add tests (rule.py coverage 100% now) --- tests/test_rule.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_rule.py b/tests/test_rule.py index 9c570cb5..08274932 100644 --- a/tests/test_rule.py +++ b/tests/test_rule.py @@ -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