Skip to content

Commit d0acb8d

Browse files
committed
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.
1 parent ce40bc4 commit d0acb8d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_cmd2.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def test_edit_file_with_spaces(base_app, request, monkeypatch):
751751
test_dir = os.path.dirname(request.module.__file__)
752752
filename = os.path.join(test_dir, 'my commands.txt')
753753

754-
run_cmd(base_app, 'edit {!r}'.format(filename))
754+
run_cmd(base_app, 'edit "{}"'.format(filename))
755755

756756
# We think we have an editor, so should expect a system call
757757
m.assert_called_once_with('"{}" "{}"'.format(base_app.editor, filename))
@@ -911,7 +911,10 @@ def test_default_to_shell_unknown(shell_app):
911911
def test_default_to_shell_good(capsys):
912912
app = cmd2.Cmd()
913913
app.default_to_shell = True
914-
line = 'ls'
914+
if sys.platform.startswith('win'):
915+
line = 'dir'
916+
else:
917+
line = 'ls'
915918
statement = app.parser_manager.parsed(line)
916919
retval = app.default(statement)
917920
assert not retval

0 commit comments

Comments
 (0)