summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-26 00:07:52 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-26 00:07:52 -0400
commit61698b2fc28daad462da9e459318e3208e0d7920 (patch)
treefbed2371272ea5246931b8ed53ea1860f0529b8d /tests
parentf08b0ce5a4ae5fec19ecd9d66416c32fe89a3a4e (diff)
downloadcmd2-git-61698b2fc28daad462da9e459318e3208e0d7920.tar.gz
Renamed style_message to style
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmd2.py4
-rw-r--r--tests/test_utils.py10
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 2c6a4eb0..5ff8513f 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(utils.style_message(msg, fg='cyan'))
+ outsim_app.poutput(utils.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(utils.style_message(msg, fg='cyan'))
+ outsim_app.poutput(utils.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 ada8bc86..e1f34b8a 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -25,21 +25,21 @@ def test_ansi_safe_wcswidth():
ansi_str = Fore.GREEN + base_str + Fore.RESET
assert cu.ansi_safe_wcswidth(ansi_str) != len(ansi_str)
-def test_style_message():
+def test_style():
base_str = HELLO_WORLD
ansi_str = Fore.BLUE + Back.GREEN + base_str + Fore.RESET + Back.RESET
- assert cu.style_message(base_str, fg='blue', bg='green') == ansi_str
+ assert cu.style(base_str, fg='blue', bg='green') == ansi_str
-def test_style_message_color_not_exist():
+def test_style_color_not_exist():
base_str = HELLO_WORLD
try:
- cu.style_message(base_str, fg='hello', bg='green')
+ cu.style(base_str, fg='hello', bg='green')
assert False
except ValueError:
assert True
try:
- cu.style_message(base_str, fg='blue', bg='hello')
+ cu.style(base_str, fg='blue', bg='hello')
assert False
except ValueError:
assert True