diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-24 13:18:57 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-24 13:18:57 -0400 |
commit | b20bd6b3d14c20b5da669c919b5d19d728ba11ef (patch) | |
tree | 1c358741f4e2fa579e1a0df149798f09ee4a224c /tests/test_cmd2.py | |
parent | 3bc87c3e7de1891431e3a4463164816b96eb64b1 (diff) | |
download | cmd2-git-b20bd6b3d14c20b5da669c919b5d19d728ba11ef.tar.gz |
Updated unit tests
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index f0ccbfe1..16c5eed4 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -429,31 +429,30 @@ def test_relative_run_script(base_app, request): def test_relative_run_script_with_odd_file_names(base_app, monkeypatch): """Test file names with various patterns""" - # Mock out the do_run_script call to see what args are passed + # Mock out the do_run_script call to see what args are passed to it run_script_mock = mock.MagicMock(name='do_run_script') monkeypatch.setattr("cmd2.Cmd.do_run_script", run_script_mock) file_name = utils.quote_string('nothingweird.txt') - out, err = run_cmd(base_app, "run_script {}".format(file_name)) + out, err = run_cmd(base_app, "_relative_run_script {}".format(file_name)) run_script_mock.assert_called_once_with('"nothingweird.txt"') run_script_mock.reset_mock() file_name = utils.quote_string('has spaces.txt') - out, err = run_cmd(base_app, "run_script {}".format(file_name)) + out, err = run_cmd(base_app, "_relative_run_script {}".format(file_name)) run_script_mock.assert_called_once_with('"has spaces.txt"') run_script_mock.reset_mock() file_name = utils.quote_string('"is_double_quoted.txt"') - out, err = run_cmd(base_app, "run_script {}".format(file_name)) + out, err = run_cmd(base_app, "_relative_run_script {}".format(file_name)) run_script_mock.assert_called_once_with('\'"is_double_quoted.txt"\'') run_script_mock.reset_mock() file_name = utils.quote_string("'is_single_quoted.txt'") - out, err = run_cmd(base_app, "run_script {}".format(file_name)) + out, err = run_cmd(base_app, "_relative_run_script {}".format(file_name)) run_script_mock.assert_called_once_with('"\'is_single_quoted.txt\'"') run_script_mock.reset_mock() - def test_relative_run_script_requires_an_argument(base_app): out, err = run_cmd(base_app, '_relative_run_script') assert 'Error: the following arguments' in err[1] @@ -685,7 +684,7 @@ def test_edit_file(base_app, request, monkeypatch): def test_edit_file_with_odd_file_names(base_app, monkeypatch): """Test editor and file names with various patterns""" - # Mock out the do_shell call to see what args are passed + # Mock out the do_shell call to see what args are passed to it shell_mock = mock.MagicMock(name='do_shell') monkeypatch.setattr("cmd2.Cmd.do_shell", shell_mock) |