From f970c16756803ad8c03c5e544f09acd4431d8b16 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 7 Jan 2020 13:07:03 -0500 Subject: Added dim text style support --- tests/test_ansi.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_ansi.py b/tests/test_ansi.py index 2382c333..cb68cb28 100644 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -45,10 +45,16 @@ def test_style_bg(): def test_style_bold(): base_str = HELLO_WORLD - ansi_str = ansi.BRIGHT + base_str + ansi.NORMAL + ansi_str = ansi.INTENSITY_BRIGHT + base_str + ansi.INTENSITY_NORMAL assert ansi.style(base_str, bold=True) == ansi_str +def test_style_dim(): + base_str = HELLO_WORLD + ansi_str = ansi.INTENSITY_DIM + base_str + ansi.INTENSITY_NORMAL + assert ansi.style(base_str, dim=True) == ansi_str + + def test_style_underline(): base_str = HELLO_WORLD ansi_str = ansi.UNDERLINE_ENABLE + base_str + ansi.UNDERLINE_DISABLE @@ -59,9 +65,12 @@ def test_style_multi(): base_str = HELLO_WORLD fg_color = 'blue' bg_color = 'green' - ansi_str = ansi.FG_COLORS[fg_color] + ansi.BG_COLORS[bg_color] + ansi.BRIGHT + ansi.UNDERLINE_ENABLE + \ - base_str + ansi.FG_RESET + ansi.BG_RESET + ansi.NORMAL + ansi.UNDERLINE_DISABLE - assert ansi.style(base_str, fg=fg_color, bg=bg_color, bold=True, underline=True) == ansi_str + ansi_str = (ansi.FG_COLORS[fg_color] + ansi.BG_COLORS[bg_color] + + ansi.INTENSITY_BRIGHT + ansi.INTENSITY_DIM + ansi.UNDERLINE_ENABLE + + base_str + + ansi.FG_RESET + ansi.BG_RESET + + ansi.INTENSITY_NORMAL + ansi.INTENSITY_NORMAL + ansi.UNDERLINE_DISABLE) + assert ansi.style(base_str, fg=fg_color, bg=bg_color, bold=True, dim=True, underline=True) == ansi_str def test_style_color_not_exist(): -- cgit v1.2.1