diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-08-21 13:26:22 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-08-21 13:26:22 -0400 |
commit | d0acb8d8767689155ab0a3fbfd66e3042aab4c4b (patch) | |
tree | 384e4ad8248dda6d1dd00ff866e0bf0d93e1c494 | |
parent | ce40bc4dd8484c2de9eb32671df515b0d567dd4f (diff) | |
download | cmd2-git-d0acb8d8767689155ab0a3fbfd66e3042aab4c4b.tar.gz |
Fixed a unit test which was failing on Windows
Also fixed a 2nd unrelated unit test which sometimes failed on Windows, depending on what tools were installed or not.
-rw-r--r-- | tests/test_cmd2.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 11af8657..10631ffa 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -751,7 +751,7 @@ def test_edit_file_with_spaces(base_app, request, monkeypatch): test_dir = os.path.dirname(request.module.__file__) filename = os.path.join(test_dir, 'my commands.txt') - run_cmd(base_app, 'edit {!r}'.format(filename)) + run_cmd(base_app, 'edit "{}"'.format(filename)) # We think we have an editor, so should expect a system call m.assert_called_once_with('"{}" "{}"'.format(base_app.editor, filename)) @@ -911,7 +911,10 @@ def test_default_to_shell_unknown(shell_app): def test_default_to_shell_good(capsys): app = cmd2.Cmd() app.default_to_shell = True - line = 'ls' + if sys.platform.startswith('win'): + line = 'dir' + else: + line = 'ls' statement = app.parser_manager.parsed(line) retval = app.default(statement) assert not retval |