diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-04 23:06:55 -0700 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-04 23:06:55 -0700 |
commit | c43392601d30df6e79e4a9c044a16b7abe5f6ab1 (patch) | |
tree | f657324bcc5f86d54ecaa8e82fb75a57590ec9e9 /tests/test_cmd2.py | |
parent | 59969dd42694d4b1d11cd1be11adf2d6db41df55 (diff) | |
download | cmd2-git-c43392601d30df6e79e4a9c044a16b7abe5f6ab1.tar.gz |
Fixed unit test failures
Fixed following unit test failures:
- Doc build failure due to Sphinx warnings
- Windows unit test failures related to colorize (hopefully)
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 85e6c2f8..6fb64b86 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -813,11 +813,7 @@ def test_base_colorize(base_app): # But if we create a fresh Cmd() instance, it will fresh_app = cmd2.Cmd() color_test = fresh_app.colorize('Test', 'red') - # Actually, colorization only ANSI escape codes is only applied on non-Windows systems - if sys.platform == 'win32': - assert color_test == 'Test' - else: - assert color_test == '\x1b[31mTest\x1b[39m' + assert color_test == '\x1b[31mTest\x1b[39m' def _expected_no_editor_error(): expected_exception = 'OSError' @@ -1107,14 +1103,9 @@ def test_ansi_prompt_escaped(): readline_hack_end = "\x02" readline_safe_prompt = app._surround_ansi_escapes(color_prompt) - if sys.platform.startswith('win'): - # colorize() does nothing on Windows due to lack of ANSI color support - assert prompt == color_prompt - assert readline_safe_prompt == prompt - else: - assert prompt != color_prompt - assert readline_safe_prompt.startswith(readline_hack_start + app._colorcodes[color][True] + readline_hack_end) - assert readline_safe_prompt.endswith(readline_hack_start + app._colorcodes[color][False] + readline_hack_end) + assert prompt != color_prompt + assert readline_safe_prompt.startswith(readline_hack_start + app._colorcodes[color][True] + readline_hack_end) + assert readline_safe_prompt.endswith(readline_hack_start + app._colorcodes[color][False] + readline_hack_end) class HelpApp(cmd2.Cmd): |