summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxNinjaKittyx <sangbumahn@gmail.com>2019-06-24 17:54:15 -0700
committerxNinjaKittyx <sangbumahn@gmail.com>2019-06-24 17:54:15 -0700
commite8206628eefe8234cb5118807c6f40e983c2a316 (patch)
tree455fda269bf89e5a6195059083179b8b44d51754 /tests
parentbef07746e33da9def33d814913891384a545a95c (diff)
downloadcmd2-git-e8206628eefe8234cb5118807c6f40e983c2a316.tar.gz
Initial Commit for Issue 698
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmd2.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 9a5b2b47..99176415 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1459,18 +1459,16 @@ def test_poutput_none(outsim_app):
def test_poutput_color_always(outsim_app):
msg = 'Hello World'
- color = Fore.CYAN
outsim_app.colors = 'Always'
- outsim_app.poutput(msg, color=color)
+ outsim_app.poutput(msg, fg='cyan')
out = outsim_app.stdout.getvalue()
- expected = color + msg + '\n' + Fore.RESET
+ expected = Fore.CYAN + msg + Style.RESET_ALL + '\n'
assert out == expected
def test_poutput_color_never(outsim_app):
msg = 'Hello World'
- color = Fore.CYAN
outsim_app.colors = 'Never'
- outsim_app.poutput(msg, color=color)
+ outsim_app.poutput(msg, fg='cyan')
out = outsim_app.stdout.getvalue()
expected = msg + '\n'
assert out == expected
@@ -1903,14 +1901,14 @@ class ColorsApp(cmd2.Cmd):
def do_echo(self, args):
self.poutput(args)
- self.perror(args, False)
+ self.pexcept(args, traceback_war=False)
def do_echo_error(self, args):
color_on = Fore.RED + Back.BLACK
color_off = Style.RESET_ALL
self.poutput(color_on + args + color_off)
- # perror uses colors by default
- self.perror(args, False)
+ # pexcept uses colors by default
+ self.pexcept(args, traceback_war=False)
def test_colors_default():
app = ColorsApp()