summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-26 13:04:16 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-26 13:04:16 -0400
commit9f07daaff4763989c89ab51f64e190dc5ba825fe (patch)
tree182b8de91e9e564a2428471eee2491edeca9258b /tests
parentcd396d3ed9c2ea5aafa7f42d7396b4f0f6cd7941 (diff)
downloadcmd2-git-9f07daaff4763989c89ab51f64e190dc5ba825fe.tar.gz
Changed signature of style() to allow for simpler calling and overriding of settings in a provided TextStyle
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmd2.py4
-rw-r--r--tests/test_utils.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 80077a68..3b6089f4 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1460,7 +1460,7 @@ def test_poutput_none(outsim_app):
def test_poutput_color_always(outsim_app):
msg = 'Hello World'
outsim_app.colors = 'Always'
- outsim_app.poutput(ansi.style(msg, ansi.TextStyle(fg='cyan')))
+ outsim_app.poutput(ansi.style(msg, fg='cyan'))
out = outsim_app.stdout.getvalue()
expected = Fore.CYAN + msg + Fore.RESET + '\n'
assert out == expected
@@ -1468,7 +1468,7 @@ def test_poutput_color_always(outsim_app):
def test_poutput_color_never(outsim_app):
msg = 'Hello World'
outsim_app.colors = 'Never'
- outsim_app.poutput(ansi.style(msg, ansi.TextStyle(fg='cyan')))
+ outsim_app.poutput(ansi.style(msg, fg='cyan'))
out = outsim_app.stdout.getvalue()
expected = msg + '\n'
assert out == expected
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 6e3600db..a4db3132 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -29,18 +29,18 @@ def test_ansi_safe_wcswidth():
def test_style():
base_str = HELLO_WORLD
ansi_str = Fore.BLUE + Back.GREEN + base_str + Fore.RESET + Back.RESET
- assert ansi.style(base_str, ansi.TextStyle(fg='blue', bg='green')) == ansi_str
+ assert ansi.style(base_str, fg='blue', bg='green') == ansi_str
def test_style_color_not_exist():
base_str = HELLO_WORLD
try:
- ansi.style(base_str, ansi.TextStyle(fg='fake', bg='green'))
+ ansi.style(base_str, fg='fake', bg='green')
assert False
except ValueError:
assert True
try:
- ansi.style(base_str, ansi.TextStyle(fg='blue', bg='fake'))
+ ansi.style(base_str, fg='blue', bg='fake')
assert False
except ValueError:
assert True