diff options
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 14 |
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() |