diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_colors.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test_colors.py b/tests/test_colors.py index 0e1bb1a..e586520 100644 --- a/tests/test_colors.py +++ b/tests/test_colors.py @@ -44,13 +44,22 @@ def test_highlights(): assert Colors.Yellow == get_highlighter(1) -def test_colorize(): +def test_colorize1(): assert ( get_code(Colors.Red) + "Hi there" + get_code(None) ) == colorize("Hi there", Colors.Red) +def test_colorize2(): + assert ( + "H" + + get_code(Colors.Red) + + "i ther" + + get_code(None) + + "e" + ) == colorize("Hi there", Colors.Red, start=1, end=7) + def test_wrap_string(): assert ( @@ -62,7 +71,9 @@ def test_wrap_string(): def test_strip_escapes(): - assert "Hi there" == strip_escapes(wrap_string("Hi there", 3, Colors.Red)) + assert "Hi there" == strip_escapes( + colorize("Hi there", Colors.Red, start=3) + ) assert strip_escapes( colorize("Hi", None, bold=True) + |