summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-01-07 13:07:03 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-01-07 13:07:03 -0500
commitf970c16756803ad8c03c5e544f09acd4431d8b16 (patch)
tree52fa81d5873485bb514e98e78d72b0e68f2d1968 /tests
parente6f251fd733236cfe0dbd9ebb9393dd487668c8e (diff)
downloadcmd2-git-f970c16756803ad8c03c5e544f09acd4431d8b16.tar.gz
Added dim text style support
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ansi.py17
1 files changed, 13 insertions, 4 deletions
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():